fix change_info to get pkg info properly 16/59716/1 accepted/tizen/ivi/20160225.081534 accepted/tizen/mobile/20160225.081450 accepted/tizen/tv/20160225.081506 accepted/tizen/wearable/20160225.081519 submit/tizen/20160224.000443 submit/tizen/20160224.092603
authorJunghyun Yeon <jungh.yeon@samsung.com>
Wed, 17 Feb 2016 23:39:02 +0000 (08:39 +0900)
committerJunghyun Yeon <jungh.yeon@samsung.com>
Wed, 17 Feb 2016 23:39:02 +0000 (08:39 +0900)
Change-Id: I2c2869f2703c664835654da36062c562bbf16b01
Signed-off-by: Junghyun Yeon <jungh.yeon@samsung.com>
src/pkgmgr-server.c
src/request.c

index 230862a..d0dfa91 100644 (file)
@@ -735,7 +735,21 @@ void __change_item_info(pm_dbus_msg *item, uid_t uid)
        char *pkgid = NULL;
        pkgmgrinfo_appinfo_h handle = NULL;
 
-       ret = pkgmgrinfo_appinfo_get_usr_appinfo(item->pkgid, uid, &handle);
+       switch (item->req_type) {
+       case PKGMGR_REQUEST_TYPE_DISABLE_APP:
+       case PKGMGR_REQUEST_TYPE_DISABLE_GLOBAL_APP_FOR_UID:
+               ret = pkgmgrinfo_appinfo_get_usr_appinfo(item->pkgid, uid, &handle);
+               break;
+
+       case PKGMGR_REQUEST_TYPE_ENABLE_APP:
+       case PKGMGR_REQUEST_TYPE_ENABLE_GLOBAL_APP_FOR_UID:
+               ret = pkgmgrinfo_appinfo_get_usr_disabled_appinfo(item->pkgid, uid, &handle);
+               break;
+
+       default:
+               return;
+       }
+
        if (ret != PMINFO_R_OK)
                return;
 
@@ -1188,7 +1202,7 @@ gboolean queue_job(void *data)
        strncpy(ptr->args, item->args, MAX_PKG_ARGS_LEN-1);
        memset((item->appid),0,MAX_PKG_NAME_LEN);
        ptr->uid = item->uid;
-       DBG("handle request type [%d]", ptr->pid, item->req_type);
+       DBG("handle request type [%d]", item->req_type);
 
        switch (item->req_type) {
        case PKGMGR_REQUEST_TYPE_INSTALL:
index ba202b2..e1ed522 100644 (file)
@@ -404,7 +404,7 @@ static int __handle_request_enable_app(uid_t uid,
        g_variant_get(parameters, "(u&s)", &target_uid, &appid);
        if (target_uid == (uid_t)-1 || appid == NULL) {
                g_dbus_method_invocation_return_value(invocation,
-                               g_variant_new("(i)", PKGMGR_R_ECOMM));
+                               g_variant_new("(is)", PKGMGR_R_ECOMM, ""));
                return -1;
        }
 
@@ -445,7 +445,7 @@ static int __handle_request_disable_app(uid_t uid,
        g_variant_get(parameters, "(u&s)", &target_uid, &appid);
        if (target_uid == (uid_t)-1 || appid == NULL) {
                g_dbus_method_invocation_return_value(invocation,
-                               g_variant_new("(i)", PKGMGR_R_ECOMM));
+                               g_variant_new("(is)", PKGMGR_R_ECOMM, ""));
                return -1;
        }
 
@@ -486,7 +486,7 @@ static int __handle_request_enable_global_app_for_uid(uid_t uid,
        g_variant_get(parameters, "(u&s)", &target_uid, &appid);
        if (target_uid == (uid_t)-1 || appid == NULL) {
                g_dbus_method_invocation_return_value(invocation,
-                               g_variant_new("(i)", PKGMGR_R_ECOMM));
+                               g_variant_new("(is)", PKGMGR_R_ECOMM, ""));
                return -1;
        }
 
@@ -527,7 +527,7 @@ static int __handle_request_disable_global_app_for_uid(uid_t uid,
        g_variant_get(parameters, "(u&s)", &target_uid, &appid);
        if (target_uid == (uid_t)-1 || appid == NULL) {
                g_dbus_method_invocation_return_value(invocation,
-                               g_variant_new("(i)", PKGMGR_R_ECOMM));
+                               g_variant_new("(is)", PKGMGR_R_ECOMM, ""));
                return -1;
        }