cap: Add new "pkgcmd_debugmode" capability for pkgcmd debug mode 09/112009/3 accepted/tizen/3.0/common/20170201.163917 accepted/tizen/3.0/ivi/20170201.034920 accepted/tizen/3.0/mobile/20170201.034830 accepted/tizen/3.0/tv/20170201.034848 accepted/tizen/3.0/wearable/20170201.034904 submit/tizen_3.0/20170126.054419
authorMunkyu Im <munkyu.im@samsung.com>
Wed, 25 Jan 2017 09:04:22 +0000 (18:04 +0900)
committerSeokYeon Hwang <syeon.hwang@samsung.com>
Thu, 26 Jan 2017 05:42:43 +0000 (21:42 -0800)
To support screenshot,
App should be installed with "pkgcmd -G" command.
It is activated by enabling "pkgcmd_debugmode" capability.

Change-Id: I0c65fbff2155f6d96cc1cfc39102844fce7c4ea6
Signed-off-by: Munkyu Im <munkyu.im@samsung.com>
src/default_plugin_basic.c
src/sdb.c
src/sdb.h
src/sdbd_plugin.h
src/services.c

index 91d8df2..1046bdc 100644 (file)
@@ -78,6 +78,8 @@ int get_plugin_capability ( parameters* in, parameters* out )
         make_string_parameter ( & ( out->array_of_parameter[0] ), "%s", LOG_DIRECTORY );
     } else if ( capability == CAPABILITY_APPCMD ) {
         make_string_parameter ( & ( out->array_of_parameter[0] ), "%s", PLUGIN_RET_ENABLED );
+    } else if (capability == CAPABILITY_DEBUGMODE ) {
+        make_string_parameter ( & ( out->array_of_parameter[0] ), "%s", PLUGIN_RET_ENABLED );
     } else {
         out->number_of_parameter = 0;
         free ( out->array_of_parameter );
index a07a881..a5e853d 100644 (file)
--- a/src/sdb.c
+++ b/src/sdb.c
@@ -1867,6 +1867,15 @@ static void init_capabilities(void) {
     }
 
 
+    // pkgcmd debug mode support
+    if(!request_capability_to_plugin(CAPABILITY_DEBUGMODE, g_capabilities.pkgcmd_debugmode,
+                sizeof(g_capabilities.pkgcmd_debugmode))) {
+        D("failed to request. (%d:%d) \n", PLUGIN_SYNC_CMD_CAPABILITY, CAPABILITY_DEBUGMODE);
+        snprintf(g_capabilities.pkgcmd_debugmode, sizeof(g_capabilities.pkgcmd_debugmode),
+                "%s", ENABLED);
+    }
+
+
     // Zone support
     ret = is_container_enabled();
     snprintf(g_capabilities.zone_support, sizeof(g_capabilities.zone_support),
index 226da64..fd71307 100644 (file)
--- a/src/sdb.h
+++ b/src/sdb.h
@@ -294,6 +294,7 @@ typedef struct platform_capabilities
     char sdbd_version[CAPBUF_ITEMSIZE];         // sdbd version
     char sdbd_plugin_version[CAPBUF_ITEMSIZE];  // sdbd plugin version
     char sdbd_cap_version[CAPBUF_ITEMSIZE];     // capability version
+    char pkgcmd_debugmode[CAPBUF_ITEMSIZE];     // enabled or disabled
 } pcap;
 extern pcap g_capabilities;
 
index e98ef69..0a9287a 100644 (file)
@@ -73,6 +73,7 @@
 #define CAPABILITY_LOG_PATH             10010
 #define CAPABILITY_APPCMD               10011
 #define CAPABILITY_ENCRYPTION           10012
+#define CAPABILITY_DEBUGMODE            10013
 
 // ===============================================================================
 // priority definition
index b0f2e08..6b61d94 100644 (file)
@@ -955,6 +955,9 @@ static void get_capability(int fd, void *cookie) {
     offset += put_key_value_string(cap_buffer, offset, CAPBUF_SIZE,
             "log_path", g_capabilities.log_path);
 
+    offset += put_key_value_string(cap_buffer, offset, CAPBUF_SIZE,
+            "pkgcmd_debugmode", g_capabilities.pkgcmd_debugmode);
+
     // Application command support
     offset += put_key_value_string(cap_buffer, offset, CAPBUF_SIZE,
             "appcmd_support", g_capabilities.appcmd_support);