add URL support for appsetting UG
authorMyoungJune Park <mj2004.park@samsung.com>
Mon, 8 Apr 2013 14:01:36 +0000 (23:01 +0900)
committerMyoungJune Park <mj2004.park@samsung.com>
Mon, 8 Apr 2013 14:01:36 +0000 (23:01 +0900)
- it's a little bit tricky.
- need to get support from f/w

setting-plugin/src/setting-plugin-main.c
setting-plugin/src/setting-plugin.c

index 6088a0c..bfaa484 100755 (executable)
@@ -21,6 +21,8 @@
 #include <setting-plugin-main.h>
 #include <Ecore_X.h>
 
+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;
-
 }
 
index 9300afc..9fe8fd2 100755 (executable)
@@ -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 */