summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJaeho Lee <jaeho81.lee@samsung.com>2013-10-12 14:41:24 +0900
committerSunwook Bae <sunwook45.bae@samsung.com>2013-11-27 14:02:14 +0900
commitb3e81797b08679aad1a2cce4ab3f31574c5bc231 (patch)
tree5e7777c18c402a1291ca22d05e4f411bae58721a
parent3e873ba073701814bfafcf106bb3eb68cb968a2b (diff)
downloadaul-1-b3e81797b08679aad1a2cce4ab3f31574c5bc231.tar.gz
aul-1-b3e81797b08679aad1a2cce4ab3f31574c5bc231.tar.bz2
aul-1-b3e81797b08679aad1a2cce4ab3f31574c5bc231.zip
Fix a launch bug at installation
Change-Id: I51e944de3bc6647f425ace0a6ea48c50b43dc5ff Signed-off-by: Sunwook Bae <sunwook45.bae@samsung.com>
-rwxr-xr-xam_daemon/amd_appinfo.c54
-rwxr-xr-xpackaging/aul.spec2
2 files changed, 54 insertions, 2 deletions
diff --git a/am_daemon/amd_appinfo.c b/am_daemon/amd_appinfo.c
index 94f73f5d..5349bd24 100755
--- a/am_daemon/amd_appinfo.c
+++ b/am_daemon/amd_appinfo.c
@@ -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,52 @@ 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, "update", 6) == 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);
+ } else if (strncmp(key,"end", 3) == 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_info_insert_handler, user_data);
+ if (ret != PMINFO_R_OK) {
+ pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
+ return -1;
+ }
+ pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
+ }
+ return ret;
+}
+
int appinfo_init(struct appinfomgr **cf)
{
struct appinfomgr *_cf;
@@ -326,6 +372,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;
diff --git a/packaging/aul.spec b/packaging/aul.spec
index 120ed87d..01e294ce 100755
--- a/packaging/aul.spec
+++ b/packaging/aul.spec
@@ -2,7 +2,7 @@
Name: aul
Summary: App utility library
-Version: 0.0.282
+Version: 0.0.286
Release: 1
Group: System/Libraries
License: Apache-2.0