From: Hwankyu Jhun Date: Mon, 23 May 2016 00:56:10 +0000 (+0900) Subject: Add checking the privilege in app_context_get_app_state API X-Git-Tag: submit/tizen/20160523.020650^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=87a2d51008a9d71334fd4fa183089c6e8f5cc349;p=platform%2Fcore%2Fapi%2Fapp-manager.git Add checking the privilege in app_context_get_app_state API Change-Id: I12c3a525e74d5b9e76a6ea895debaca14356b5af Signed-off-by: Hwankyu Jhun --- diff --git a/src/app_context.c b/src/app_context.c index f43241e..5509bac 100644 --- a/src/app_context.c +++ b/src/app_context.c @@ -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;