Add the can_launch member to capability structure. 51/86251/1 accepted/tizen/common/20160902.062103 submit/tizen/20160902.053432
authorKim Gunsoo <gunsoo83.kim@samsung.com>
Mon, 23 Nov 2015 06:20:53 +0000 (15:20 +0900)
committerKim Gunsoo <gunsoo83.kim@samsung.com>
Wed, 31 Aug 2016 05:27:58 +0000 (14:27 +0900)
- The can_launch member is used to determine whether to
  install/launch an Application for the corresponding platform
  in the IDE.
- To obtain the can_launch information, queries the sdbd plugin.

Change-Id: Ic39cc0dce2267190de2e6052172a6333a1e5882b
Signed-off-by: Kim Gunsoo <gunsoo83.kim@samsung.com>
src/sdb.c
src/sdb.h
src/sdbd_plugin.h
src/services.c

index 22d279441869448bdbf7295dfd0f76df0863dc15..f44b32d17df855c9c15eeb8a97d8f63d1f9aea82 100644 (file)
--- a/src/sdb.c
+++ b/src/sdb.c
@@ -1599,6 +1599,10 @@ static int get_plugin_capability(const char* in_buf, sdbd_plugin_param out) {
         } else {
             snprintf(out.data, out.len, "%s", SDBD_CAP_RET_DISABLED);
         }
+        ret = SDBD_PLUGIN_RET_SUCCESS;
+    } else if (SDBD_CMP_CAP(in_buf, CANLAUNCH)) {
+        snprintf(out.data, out.len, "%s", UNKNOWN);
+        ret = SDBD_PLUGIN_RET_SUCCESS;
     } else if (SDBD_CMP_CAP(in_buf, PLUGIN_VER)) {
         snprintf(out.data, out.len, "%s", UNKNOWN);
         ret = SDBD_PLUGIN_RET_SUCCESS;
@@ -2093,6 +2097,16 @@ static void init_capabilities(void) {
     }
 
 
+    // Target name of the launch possible
+    if(!request_plugin_cmd(SDBD_CMD_PLUGIN_CAP, SDBD_CAP_TYPE_CANLAUNCH,
+                            g_capabilities.can_launch,
+                            sizeof(g_capabilities.can_launch))) {
+        D("failed to request. (%s:%s) \n", SDBD_CMD_PLUGIN_CAP, SDBD_CAP_TYPE_CANLAUNCH);
+        snprintf(g_capabilities.can_launch, sizeof(g_capabilities.can_launch),
+                    "%s", UNKNOWN);
+    }
+
+
     // Platform version
     ret = system_info_get_platform_string("http://tizen.org/feature/platform.version", &value);
     if (ret != SYSTEM_INFO_ERROR_NONE) {
@@ -2132,6 +2146,7 @@ static void init_capabilities(void) {
                     "%s", UNKNOWN);
     }
 
+
     // sdbd log enable
     if(!request_plugin_cmd(SDBD_CMD_PLUGIN_CAP, SDBD_CAP_TYPE_LOG_ENABLE,
                                g_capabilities.log_enable,
@@ -2139,16 +2154,21 @@ static void init_capabilities(void) {
            D("failed to request. (%s:%s) \n", SDBD_CMD_PLUGIN_CAP, SDBD_CAP_TYPE_LOG_ENABLE);
            snprintf(g_capabilities.log_enable, sizeof(g_capabilities.log_enable),
                        "%s", DISABLED);
-       }
+    }
 
-     // sdbd log path
+    // sdbd log path
     if(!request_plugin_cmd(SDBD_CMD_PLUGIN_CAP, SDBD_CAP_TYPE_LOG_PATH,
                                g_capabilities.log_path,
                                sizeof(g_capabilities.log_path))) {
            D("failed to request. (%s:%s) \n", SDBD_CMD_PLUGIN_CAP, SDBD_CAP_TYPE_LOG_PATH);
            snprintf(g_capabilities.log_path, sizeof(g_capabilities.log_path),
                        "%s", UNKNOWN);
-       }
+    }
+
+
+    // Capability version
+    snprintf(g_capabilities.sdbd_cap_version, sizeof(g_capabilities.sdbd_cap_version),
+                "%d.%d", SDBD_CAP_VERSION_MAJOR, SDBD_CAP_VERSION_MINOR);
 }
 
 static int is_support_usbproto()
index c9a9e0c60fc25126db6e73f83fe1043f235425d9..75dba433f6830d5b7d23a4820f56f7e6486a40bb 100644 (file)
--- a/src/sdb.h
+++ b/src/sdb.h
@@ -247,6 +247,8 @@ typedef struct platform_info {
 #define CAPBUF_ITEMSIZE 32
 #define CAPBUF_L_ITEMSIZE 256
 #define CAPBUF_LL_ITEMSIZE PATH_MAX
+#define SDBD_CAP_VERSION_MAJOR 1
+#define SDBD_CAP_VERSION_MINOR 0
 typedef struct platform_capabilities
 {
     char secure_protocol[CAPBUF_ITEMSIZE];      // enabled or disabled
@@ -266,11 +268,13 @@ typedef struct platform_capabilities
     char profile_name[CAPBUF_ITEMSIZE];         // profile name (ex. mobile)
     char vendor_name[CAPBUF_ITEMSIZE];          // vendor name (ex. Tizen)
     char sdk_toolpath[CAPBUF_L_ITEMSIZE];       // sdk tool path
+    char can_launch[CAPBUF_L_ITEMSIZE];         // target name
 
     char platform_version[CAPBUF_ITEMSIZE];     // platform version (ex. 2.3.0)
     char product_version[CAPBUF_ITEMSIZE];      // product version (ex. 1.0)
     char sdbd_version[CAPBUF_ITEMSIZE];         // sdbd version
     char sdbd_plugin_version[CAPBUF_ITEMSIZE];  // sdbd plugin version
+    char sdbd_cap_version[CAPBUF_ITEMSIZE];     // capability version
 } pcap;
 pcap g_capabilities;
 
index 2d94157d717f4209e88c4ccb15c7b1c56203253a..dce56e187d12a0d71ec9ed527929a98e150b755d 100644 (file)
@@ -35,6 +35,7 @@
 #define SDBD_CAP_TYPE_USBPROTO          "usb_protocol_support"
 #define SDBD_CAP_TYPE_SOCKPROTO         "socket_protocol_support"
 #define SDBD_CAP_TYPE_ROOTONOFF         "root_onoff_support"
+#define SDBD_CAP_TYPE_CANLAUNCH         "can_launch_target"
 #define SDBD_CAP_TYPE_PLUGIN_VER        "sdbd_plugin_version"
 #define SDBD_CAP_TYPE_PRODUCT_VER       "product_version"
 #define SDBD_CAP_TYPE_LOG_ENABLE        "sdbd_log_enable"
index bc2f35a0e64ddd45ed11a33cb7da42b7011f97f2..2fbcaa797fe52798a7de63415a0bb951ee0549e3 100644 (file)
@@ -924,6 +924,10 @@ static void get_capability(int fd, void *cookie) {
     offset += put_key_value_string(cap_buffer, offset, CAPBUF_SIZE,
                                 "sockproto_support", g_capabilities.sockproto_support);
 
+    // Window size synchronization support
+    offset += put_key_value_string(cap_buffer, offset, CAPBUF_SIZE,
+                                "syncwinsz_support", g_capabilities.syncwinsz_support);
+
     // Root command support
     offset += put_key_value_string(cap_buffer, offset, CAPBUF_SIZE,
                                 "rootonoff_support", g_capabilities.rootonoff_support);
@@ -952,6 +956,10 @@ static void get_capability(int fd, void *cookie) {
     offset += put_key_value_string(cap_buffer, offset, CAPBUF_SIZE,
                                 "vendor_name", g_capabilities.vendor_name);
 
+    // Target name of the launch possible
+    offset += put_key_value_string(cap_buffer, offset, CAPBUF_SIZE,
+                                "can_launch", g_capabilities.can_launch);
+
     // Platform version
     offset += put_key_value_string(cap_buffer, offset, CAPBUF_SIZE,
                                 "platform_version", g_capabilities.platform_version);
@@ -968,9 +976,9 @@ static void get_capability(int fd, void *cookie) {
     offset += put_key_value_string(cap_buffer, offset, CAPBUF_SIZE,
                                 "sdbd_plugin_version", g_capabilities.sdbd_plugin_version);
 
-    // Window size synchronization support
+    // Capability version
     offset += put_key_value_string(cap_buffer, offset, CAPBUF_SIZE,
-                                "syncwinsz_support", g_capabilities.syncwinsz_support);
+                                "sdbd_cap_version", g_capabilities.sdbd_cap_version);
 
     // Sdbd log enable
    offset += put_key_value_string(cap_buffer, offset, CAPBUF_SIZE,