From 87a2d51008a9d71334fd4fa183089c6e8f5cc349 Mon Sep 17 00:00:00 2001 From: Hwankyu Jhun Date: Mon, 23 May 2016 09:56:10 +0900 Subject: [PATCH] Add checking the privilege in app_context_get_app_state API Change-Id: I12c3a525e74d5b9e76a6ea895debaca14356b5af Signed-off-by: Hwankyu Jhun --- src/app_context.c | 6 ++++++ 1 file changed, 6 insertions(+) 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; -- 2.7.4