Implement pkgmgrinfo_appinfo_filter_count
authorJunghyun Yeon <jungh.yeon@samsung.com>
Wed, 17 Mar 2021 01:35:11 +0000 (10:35 +0900)
committer연정현/Tizen Platform Lab(SR)/Staff Engineer/삼성전자 <jungh.yeon@samsung.com>
Wed, 17 Mar 2021 02:25:12 +0000 (11:25 +0900)
Signed-off-by: Junghyun Yeon <jungh.yeon@samsung.com>
src/pkgmgrinfo_appinfo.c

index 0ca5fd9..61103cf 100644 (file)
@@ -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);