From e3813d9746cd6da575c18f80388ef0132b9258e1 Mon Sep 17 00:00:00 2001 From: Sangyoon Jang Date: Fri, 4 Sep 2015 16:42:39 +0900 Subject: [PATCH] Add pkgmgrinfo_pkginfo_is_global get whethere the given package is global package or user package Change-Id: Ib50ee621d80227c7d7f66e2e10b9a9b47d800ff9 Signed-off-by: Sangyoon Jang --- include/pkgmgr-info.h | 6 +++--- src/pkgmgrinfo_pkginfo.c | 11 ++++++++--- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/include/pkgmgr-info.h b/include/pkgmgr-info.h index 063097c..439cb6a 100644 --- a/include/pkgmgr-info.h +++ b/include/pkgmgr-info.h @@ -1445,8 +1445,8 @@ static int get_pkg_support_disable(const char *pkgid) int pkgmgrinfo_pkginfo_is_support_disable(pkgmgrinfo_pkginfo_h handle, bool *support_disable); /** - * @fn int pkgmgrinfo_pkginfo_is_global(uid_t uid, const char *pkgid) - * @brief This API gets the package 'uid' value from the view table of user database + * @fn int pkgmgrinfo_pkginfo_is_global(pkgmgrinfo_pkginfo_h handle, bool *global) + * @brief This API gets whethere the given package is global package or user package * * @par This API is for package-manager client application * @par Sync (or) Async : Synchronous API @@ -1456,7 +1456,7 @@ int pkgmgrinfo_pkginfo_is_support_disable(pkgmgrinfo_pkginfo_h handle, bool *sup * @return 1 if it a global package, 0 else */ -int pkgmgrinfo_pkginfo_is_global(uid_t uid, const char *pkgid); +int pkgmgrinfo_pkginfo_is_global(pkgmgrinfo_pkginfo_h handle, bool *global); /** diff --git a/src/pkgmgrinfo_pkginfo.c b/src/pkgmgrinfo_pkginfo.c index 932ebdd..1427f53 100644 --- a/src/pkgmgrinfo_pkginfo.c +++ b/src/pkgmgrinfo_pkginfo.c @@ -1659,21 +1659,26 @@ API int pkgmgrinfo_pkginfo_is_support_disable(pkgmgrinfo_pkginfo_h handle, bool return PMINFO_R_OK; } -API int pkgmgrinfo_pkginfo_is_for_all_users(pkgmgrinfo_pkginfo_h handle, bool *for_all_users) +API int pkgmgrinfo_pkginfo_is_global(pkgmgrinfo_pkginfo_h handle, bool *global) { pkgmgr_pkginfo_x *info = (pkgmgr_pkginfo_x *)handle; retvm_if(handle == NULL, PMINFO_R_EINVAL, "pkginfo handle is NULL\n"); - retvm_if(for_all_users == NULL, PMINFO_R_EINVAL, "Argument supplied to hold return value is NULL\n"); + retvm_if(global == NULL, PMINFO_R_EINVAL, "Argument supplied to hold return value is NULL\n"); if (info->pkg_info == NULL || info->pkg_info->for_all_users == NULL) return PMINFO_R_ERROR; - *for_all_users = _get_bool_value(info->pkg_info->for_all_users); + *global = _get_bool_value(info->pkg_info->for_all_users); return PMINFO_R_OK; } +API int pkgmgrinfo_pkginfo_is_for_all_users(pkgmgrinfo_pkginfo_h handle, bool *for_all_users) +{ + return pkgmgrinfo_pkginfo_is_global(handle, for_all_users); +} + API int pkgmgrinfo_pkginfo_destroy_pkginfo(pkgmgrinfo_pkginfo_h handle) { pkgmgr_pkginfo_x *info = (pkgmgr_pkginfo_x *)handle; -- 2.7.4