From d88572c51081d11376a9b5bf91c40eb7561f20bb Mon Sep 17 00:00:00 2001 From: Junghyun Yeon Date: Wed, 17 Mar 2021 10:35:11 +0900 Subject: [PATCH] Implement pkgmgrinfo_appinfo_filter_count Signed-off-by: Junghyun Yeon --- src/pkgmgrinfo_appinfo.c | 9 +++++++++ 1 file changed, 9 insertions(+) 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); -- 2.7.4