From: Junghyun Yeon Date: Wed, 17 Mar 2021 01:35:11 +0000 (+0900) Subject: Implement pkgmgrinfo_appinfo_filter_count X-Git-Tag: submit/tizen/20210317.082331~4 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d88572c51081d11376a9b5bf91c40eb7561f20bb;p=platform%2Fcore%2Fappfw%2Fpkgmgr-info.git Implement pkgmgrinfo_appinfo_filter_count Signed-off-by: Junghyun Yeon --- diff --git a/src/pkgmgrinfo_appinfo.c b/src/pkgmgrinfo_appinfo.c index 0ca5fd9..61103cf 100644 --- a/src/pkgmgrinfo_appinfo.c +++ b/src/pkgmgrinfo_appinfo.c @@ -2310,12 +2310,15 @@ API int pkgmgrinfo_appinfo_filter_add_string(pkgmgrinfo_appinfo_filter_h handle, API int pkgmgrinfo_appinfo_usr_filter_count(pkgmgrinfo_appinfo_filter_h handle, int *count, uid_t uid) { GHashTable *list; + int ret; + pkgmgrinfo_filter_x *filter; if (handle == NULL || count == NULL) { _LOGE("invalid parameter"); return PMINFO_R_EINVAL; } + filter = (pkgmgrinfo_filter_x *)handle; list = g_hash_table_new_full(g_str_hash, g_str_equal, NULL, __free_applications); if (list == NULL) @@ -2339,6 +2342,12 @@ API int pkgmgrinfo_appinfo_usr_filter_count(pkgmgrinfo_appinfo_filter_h handle, } } + ret = _appinfo_get_applications(uid, uid, filter, 0, list); + if (ret != PMINFO_R_OK) { + g_hash_table_destroy(list); + return PMINFO_R_ERROR; + } + *count = g_hash_table_size(list); g_hash_table_destroy(list);