Add checking the privilege in app_context_get_app_state API 15/70815/1 accepted/tizen/common/20160525.155322 submit/tizen/20160523.020650
authorHwankyu Jhun <h.jhun@samsung.com>
Mon, 23 May 2016 00:56:10 +0000 (09:56 +0900)
committerHwankyu Jhun <h.jhun@samsung.com>
Mon, 23 May 2016 00:56:10 +0000 (09:56 +0900)
Change-Id: I12c3a525e74d5b9e76a6ea895debaca14356b5af
Signed-off-by: Hwankyu Jhun <h.jhun@samsung.com>
src/app_context.c

index f43241e..5509bac 100644 (file)
@@ -339,9 +339,15 @@ API int app_context_get_package_id(app_context_h app_context, char **pkg_id)
 
 API int app_context_get_app_state(app_context_h app_context, app_state_e *state)
 {
+       int ret;
+
        if (app_context == NULL || state == NULL)
                return app_manager_error(APP_MANAGER_ERROR_INVALID_PARAMETER, __FUNCTION__, NULL);
 
+       ret = app_manager_check_privilege(PRIVILEGE_PKGMGR_INFO);
+       if (ret != APP_MANAGER_ERROR_NONE)
+               return app_manager_error(ret, __FUNCTION__, NULL);
+
        *state = app_context->app_state;
 
        return APP_MANAGER_ERROR_NONE;