From: Sangyoon Jang Date: Tue, 1 Sep 2015 10:08:10 +0000 (+0900) Subject: Fix to check return value of pkgmgr-info api X-Git-Tag: accepted/tizen/mobile/20150902.004401^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F47%2F47247%2F2;p=platform%2Fcore%2Fappfw%2Falarm-manager.git Fix to check return value of pkgmgr-info api 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 --- diff --git a/alarm-manager.c b/alarm-manager.c index 41a7f6c..b83987f 100644 --- a/alarm-manager.c +++ b/alarm-manager.c @@ -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, };