From: Munkyu Im Date: Wed, 25 Jan 2017 09:04:22 +0000 (+0900) Subject: cap: Add new "pkgcmd_debugmode" capability for pkgcmd debug mode X-Git-Tag: submit/tizen_3.0/20170126.054419^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F09%2F112009%2F3;p=sdk%2Ftarget%2Fsdbd.git cap: Add new "pkgcmd_debugmode" capability for pkgcmd debug mode 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 --- diff --git a/src/default_plugin_basic.c b/src/default_plugin_basic.c index 91d8df2..1046bdc 100644 --- a/src/default_plugin_basic.c +++ b/src/default_plugin_basic.c @@ -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 ); diff --git a/src/sdb.c b/src/sdb.c index a07a881..a5e853d 100644 --- 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), diff --git a/src/sdb.h b/src/sdb.h index 226da64..fd71307 100644 --- 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; diff --git a/src/sdbd_plugin.h b/src/sdbd_plugin.h index e98ef69..0a9287a 100644 --- a/src/sdbd_plugin.h +++ b/src/sdbd_plugin.h @@ -73,6 +73,7 @@ #define CAPABILITY_LOG_PATH 10010 #define CAPABILITY_APPCMD 10011 #define CAPABILITY_ENCRYPTION 10012 +#define CAPABILITY_DEBUGMODE 10013 // =============================================================================== // priority definition diff --git a/src/services.c b/src/services.c index b0f2e08..6b61d94 100644 --- a/src/services.c +++ b/src/services.c @@ -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);