Fix to check return value of pkgmgr-info api 47/47247/2 accepted/tizen/mobile/20150902.004401 accepted/tizen/tv/20150902.004416 accepted/tizen/wearable/20150902.004425 submit/tizen/20150901.101407
authorSangyoon Jang <s89.jang@samsung.com>
Tue, 1 Sep 2015 10:08:10 +0000 (19:08 +0900)
committerSangyoon Jang <s89.jang@samsung.com>
Tue, 1 Sep 2015 10:11:13 +0000 (19:11 +0900)
check return value of pkgmgr-info api instead of checking handle value
use user specific pkgmgr-info api
fix indentation

Change-Id: I5b201484ef35ae1dcf9396f945abe68922fb54d6
Signed-off-by: Sangyoon Jang <s89.jang@samsung.com>
alarm-manager.c

index 41a7f6c..b83987f 100644 (file)
@@ -1209,6 +1209,7 @@ static int __have_ui_apps(bundle *b)
 
 static void __alarm_expired()
 {
+       int ret;
        const char *destination_app_service_name = NULL;
        alarm_id_t alarm_id = -1;
        int app_pid = 0;
@@ -1316,12 +1317,12 @@ static void __alarm_expired()
 
                        if (strncmp(g_quark_to_string(__alarm_info->quark_dst_service_name), "null", 4) == 0) {
                                SECURE_LOGD("[alarm-server]:destination is null, so we send expired alarm to %s(%u).",
-                                       g_quark_to_string(__alarm_info->quark_app_service_name), __alarm_info->quark_app_service_name);
-                                       destination_app_service_name = g_quark_to_string(__alarm_info->quark_app_service_name);
+                                               g_quark_to_string(__alarm_info->quark_app_service_name), __alarm_info->quark_app_service_name);
+                               destination_app_service_name = g_quark_to_string(__alarm_info->quark_app_service_name);
                        } else {
                                SECURE_LOGD("[alarm-server]:destination :%s(%u)",
-                                       g_quark_to_string(__alarm_info->quark_dst_service_name), __alarm_info->quark_dst_service_name);
-                                       destination_app_service_name = g_quark_to_string(__alarm_info->quark_dst_service_name);
+                                               g_quark_to_string(__alarm_info->quark_dst_service_name), __alarm_info->quark_dst_service_name);
+                               destination_app_service_name = g_quark_to_string(__alarm_info->quark_dst_service_name);
                        }
 
                        /*
@@ -1357,12 +1358,12 @@ static void __alarm_expired()
                                strncpy(appid,g_quark_to_string(__alarm_info->quark_dst_service_name)+6,strlen(g_quark_to_string(__alarm_info->quark_dst_service_name))-6);
                        }
 
-                       pkgmgrinfo_appinfo_get_appinfo(appid, &appinfo_handle);
+                       ret = pkgmgrinfo_appinfo_get_usr_appinfo(appid, __alarm_info->uid, &appinfo_handle);
                        ALARM_MGR_LOG_PRINT("appid : %s (%x)", appid, appinfo_handle);
 
                        // Case #2. The process was killed && App type
                        // This app is launched and owner of DBus connection is changed. and then, expiration noti is sent by DBus.
-                       if (name_has_owner_reply == false && appinfo_handle) {
+                       if (name_has_owner_reply == false && ret == PMINFO_R_OK) {
                                __expired_alarm_t *expire_info;
                                char alarm_id_str[32] = { 0, };