From 64ea0685326d7ccace75ee1d3cc869f458b2b497 Mon Sep 17 00:00:00 2001 From: MyoungJune Park Date: Mon, 8 Apr 2013 23:01:36 +0900 Subject: [PATCH] add URL support for appsetting UG - it's a little bit tricky. - need to get support from f/w --- setting-plugin/src/setting-plugin-main.c | 26 +++++++------------------- setting-plugin/src/setting-plugin.c | 13 +++++++++++++ 2 files changed, 20 insertions(+), 19 deletions(-) diff --git a/setting-plugin/src/setting-plugin-main.c b/setting-plugin/src/setting-plugin-main.c index 6088a0c..bfaa484 100755 --- a/setting-plugin/src/setting-plugin-main.c +++ b/setting-plugin/src/setting-plugin-main.c @@ -21,6 +21,8 @@ #include #include +extern int service_to_bundle(service_h service, bundle **data); + static int setting_plugin_main_create(void *cb); static int setting_plugin_main_destroy(void *cb); static int setting_plugin_main_update(void *cb); @@ -34,6 +36,8 @@ setting_view setting_view_plugin_main = { }; + + static void setting_plugin_main_click_softkey_back_cb(void *data, Evas_Object *obj, void *event_info); @@ -52,18 +56,6 @@ static int setting_plugin_main_create(void *cb) Evas_Object *scroller = NULL; - char* pappid = NULL; - int pid = getpid(); - char appid[1024]; - if (aul_app_get_appid_bypid(pid, appid, 1024) == 0) - { - SETTING_TRACE(" >> ******** AUL K APPID : (%s) \n", appid ); - pappid = appid; - } else { - SETTING_TRACE(" >> ******** AUL K APPID : ERROR \n"); - } - - /* add basic layout */ char setBtnStr[MAX_DISPLAY_NAME_LEN_ON_UI]; snprintf(setBtnStr, sizeof(setBtnStr), "%s", @@ -72,12 +64,9 @@ static int setting_plugin_main_create(void *cb) ///////////////////////////////////////////////////////////////////////////////////////////////// #if 1 // there's no argument, use pappid - if (ad->pkgname == NULL) - { - if (pappid == NULL) - goto errorhandle; - - ad->pkgname = pappid; + if (ad->pkgname == NULL) { + SETTING_TRACE("pkgname is NULL, it's error, assign it"); + goto errorhandle; } char plugin_path[1024]; @@ -170,6 +159,5 @@ static void setting_plugin_main_click_softkey_back_cb(void *data, Evas_Object *o /* Send destroy request */ ug_destroy_me(ad->ug); SETTING_TRACE_END; - } diff --git a/setting-plugin/src/setting-plugin.c b/setting-plugin/src/setting-plugin.c index 9300afc..9fe8fd2 100755 --- a/setting-plugin/src/setting-plugin.c +++ b/setting-plugin/src/setting-plugin.c @@ -165,6 +165,19 @@ static void *setting_plugin_ug_on_create(ui_gadget_h ug, if (pkgname) { pluginUG->pkgname = strdup(pkgname); + } else { + char* val = NULL; + bundle *t = NULL; + int ret = service_to_bundle(service, &t); + if(ret != SERVICE_ERROR_NONE) + return; + // it's tricky + // look for other way + val = (char*)bundle_get_val(t, AUL_K_CALLER_APPID); + val[10] = '\0'; // cut string FpeK59wYdV.FormBasedApp -> FpeK59wYdV + + pluginUG->pkgname = strdup(val); + SETTING_TRACE("get pkg name ==== %s from AUL_K_CALLDER_APPID",pluginUG->pkgname); } /* register view node table */ -- 2.7.4