get appid with aul API, if there's no 'pkgname'
authorMyoungJune Park <mj2004.park@samsung.com>
Tue, 2 Apr 2013 08:26:31 +0000 (17:26 +0900)
committerMyoungJune Park <mj2004.park@samsung.com>
Tue, 2 Apr 2013 08:40:58 +0000 (17:40 +0900)
- if there's no 'pkgname' argument, use aul API to get appid

Change-Id: I017fca8eb92db3f3cb3c5d7b5d14b1f7276beeee

org.tizen.setting.xml
setting-phone/CMakeLists.txt
setting-plugin/src/setting-plugin-main.c
setting-plugin/src/setting-plugin.c

index 2510be8..bedb1fa 100755 (executable)
                        <icon>ug-setting-plugin-efl.png</icon>
                        <label>Setting Plugin </label>
                        <label xml:lang="en-us">Setting Plugin view </label>
+                       <application-service>
+                               <operation name="http://samsung.com/appcontrol/operation/app_setting/show"/>
+                       </application-service>
+                       <application-service>
+                               <operation name="http://tizen.org/appcontrol/operation/app_setting/show"/>
+                       </application-service>
        </ui-application>
 </manifest>
 
index fa6d5f2..ff03b90 100755 (executable)
@@ -3,7 +3,7 @@ INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/${SETTING_COMMON}/include)
 
 
 INCLUDE(FindPkgConfig)
-pkg_check_modules(pkgs_phone REQUIRED evas eina ecore elementary appcore-common vconf appcore-efl haptic tapi ui-gadget-1 capi-appfw-application appsvc libxml-2.0)
+pkg_check_modules(pkgs_phone REQUIRED evas eina ecore elementary appcore-common vconf appcore-efl haptic tapi ui-gadget-1 capi-appfw-application appsvc libxml-2.0 aul)
 
 FOREACH(flag ${pkgs_phone_CFLAGS})
        SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
index 0cf6616..6088a0c 100755 (executable)
@@ -52,6 +52,18 @@ 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",
@@ -59,14 +71,20 @@ static int setting_plugin_main_create(void *cb)
 
        /////////////////////////////////////////////////////////////////////////////////////////////////
 #if 1
-       //char* plugin_path = "/opt/apps/UBKFwQidax.AppSetting4/setting/setting.xml";
+       // there's no argument, use pappid
        if (ad->pkgname == NULL)
-               goto errorhandle;
+       {
+               if (pappid == NULL)
+                       goto errorhandle;
+
+               ad->pkgname = pappid;
+       }
 
        char plugin_path[1024];
        snprintf(plugin_path, 1024, "/opt/apps/%s/setting/setting.xml", ad->pkgname);
        SETTING_TRACE(" >> SELECTED plugin name : %s \n", plugin_path);
 
+
        PluginNode* plugin_node = setting_plugin_create(ad->navi_bar, ad->win_get);
        plugin_node->win_main_layout = ad->win_main_layout;
 
index 8982965..9300afc 100755 (executable)
@@ -22,6 +22,8 @@
 #include <setting-plugin.h>
 #include <Ecore_X.h>
 
+#include <aul.h>
+
 #define SETTING_BRIGHTNESS_LEVEL_FOR_EMUL 24
 
 #ifndef UG_MODULE_API
@@ -51,7 +53,7 @@ static Evas_Object* _gl_content_handler(void* data, Evas_Object* obj, const char
 {
        SETTING_TRACE("%s ", part);
        //--------------------
-       // obj --> parent 
+       // obj --> parent
        //--------------------
 
     if (!safeStrCmp(part, "elm.icon") || !safeStrCmp(part, "elm.icon.1"))