Fix pkgmgrinfo_appinfo_get_launch_mode 07/42607/1 accepted/tizen/mobile/20150702.045219 accepted/tizen/tv/20150702.040115 accepted/tizen/wearable/20150702.040144 submit/tizen/20150702.000829
authorSangyoon Jang <s89.jang@samsung.com>
Tue, 30 Jun 2015 12:44:25 +0000 (21:44 +0900)
committerSangyoon Jang <s89.jang@samsung.com>
Tue, 30 Jun 2015 12:44:25 +0000 (21:44 +0900)
service application doesn't have launch mode

Change-Id: I1740c99a92cb01700fe32f755aa8ee01c4fdac75
Signed-off-by: Sangyoon Jang <s89.jang@samsung.com>
src/pkgmgr-info.c

index 90f246e..6a89442 100644 (file)
@@ -5872,11 +5872,15 @@ API int pkgmgrinfo_appinfo_get_launch_mode(pkgmgrinfo_appinfo_h handle, char **m
        retvm_if(handle == NULL, PMINFO_R_EINVAL, "appinfo handle is NULL\n");
        retvm_if(mode == NULL, PMINFO_R_EINVAL, "Argument supplied to hold return value is NULL\n");
        pkgmgr_appinfo_x *info = (pkgmgr_appinfo_x *)handle;
-       if (info->uiapp_info->launch_mode)
-               *mode = (char *)(info->uiapp_info->launch_mode);
-       else
+
+       if (info->app_component != PMINFO_UI_APP)
+               return PMINFO_R_EINVAL;
+
+       if (info->uiapp_info->launch_mode == NULL)
                return PMINFO_R_ERROR;
 
+       *mode = (char *)(info->uiapp_info->launch_mode);
+
        return PMINFO_R_OK;
 }