Fix a launch bug at installation
authorJaeho Lee <jaeho81.lee@samsung.com>
Sat, 12 Oct 2013 05:41:24 +0000 (14:41 +0900)
committerJaeho Lee <jaeho81.lee@samsung.com>
Sat, 12 Oct 2013 05:50:53 +0000 (14:50 +0900)
Signed-off-by: Jaeho Lee <jaeho81.lee@samsung.com>
Change-Id: I51e944de3bc6647f425ace0a6ea48c50b43dc5ff

am_daemon/amd_appinfo.c
packaging/aul.spec

index 94f73f5..e0dc2b4 100755 (executable)
@@ -277,7 +277,7 @@ static void __vconf_cb(keynode_t *key, void *data)
                g_hash_table_remove(cf->tbl, appid);
        } else if (strncmp(type_string, "update", 6) == 0){
                /*REMOVE EXISTING ENTRY & CREATE AGAIN*/
-               if (g_hash_table_remove(cf->tbl, appid) == true){
+               if (g_hash_table_remove(cf->tbl, appid)){
                        if (pkgmgrinfo_appinfo_get_appinfo(appid, &handle) == PMINFO_R_OK){
                                __app_info_insert_handler(handle, data);
                                pkgmgrinfo_appinfo_destroy_appinfo(handle);
@@ -286,6 +286,41 @@ static void __vconf_cb(keynode_t *key, void *data)
        }
 }
 
+int app_func(pkgmgrinfo_appinfo_h handle, void *user_data)
+{
+       char *appid = NULL;
+       struct appinfomgr *cf = (struct appinfomgr *)user_data;
+       int r;
+
+       pkgmgrinfo_appinfo_get_appid(handle, &appid);
+       r = g_hash_table_remove(cf->tbl, appid);
+       SECURE_LOGD("upgrading... (%s)", appid);
+
+       return 0;
+}
+
+static int __cb(int req_id, const char *pkg_type,
+                      const char *pkgid, const char *key, const char *val,
+                      const void *pmsg, void *user_data)
+{
+       int ret = 0;
+       pkgmgrinfo_pkginfo_h handle;
+
+       SECURE_LOGD("appid(%s), key(%s), value(%s)", pkgid, key, val);
+
+       if((strncmp(key,"start", 5) == 0) && (strncmp(val, "upgrade", 7) == 0) ) {
+               ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
+               if (ret != PMINFO_R_OK)
+                       return -1;
+               ret = pkgmgrinfo_appinfo_get_list(handle, PMINFO_UI_APP, app_func, user_data);
+               if (ret != PMINFO_R_OK) {
+                       pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
+                       return -1;
+               }
+               pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
+       }
+}
+
 int appinfo_init(struct appinfomgr **cf)
 {
        struct appinfomgr *_cf;
@@ -326,6 +361,12 @@ int appinfo_init(struct appinfomgr **cf)
        if (r < 0)
                _E("Unable to register vconf notification callback for VCONFKEY_MENUSCREEN_DESKTOP\n");
 
+       int event_type = PMINFO_CLIENT_STATUS_UPGRADE;
+       pkgmgrinfo_client *pc = NULL;
+       pc = pkgmgrinfo_client_new(PMINFO_REQUEST);
+       pkgmgrinfo_client_set_status_type(pc, event_type);
+       pkgmgrinfo_client_listen_status(pc, __cb , _cf);
+
        *cf = _cf;
 
        return 0;
index becbe08..0deaeaa 100644 (file)
@@ -1,6 +1,6 @@
 Name:       aul
 Summary:    App utility library
-Version:    0.0.282
+Version:    0.0.283
 Release:    1
 Group:      System/Libraries
 License:    Apache License, Version 2.0
@@ -56,6 +56,9 @@ Application utility library (devel)
 %if 0%{?simulator}
 CFLAGS="%{optflags} -D__emul__"; export CFLAGS
 %endif
+export CFLAGS="$CFLAGS -DTIZEN_ENGINEER_MODE"
+export CXXFLAGS="$CXXFLAGS -DTIZEN_ENGINEER_MODE"
+export FFLAGS="$FFLAGS -DTIZEN_ENGINEER_MODE"
 
 %cmake .