char *locale;
application_x *app;
pkgmgr_appinfo_x info;
- pkgmgrinfo_filter_x *tmp_filter = NULL;
GHashTable *list;
GHashTableIter iter;
gpointer value;
return PMINFO_R_ERROR;
}
- if (filter != NULL) {
- tmp_filter = filter;
- } else {
- ret = pkgmgrinfo_appinfo_filter_create((void *)&tmp_filter);
- if (ret != PMINFO_R_OK) {
- _LOGE("Failed to create filter");
- return PMINFO_R_ERROR;
- }
- }
-
- if (__check_disable_filter_exist(tmp_filter) == false)
- pkgmgrinfo_appinfo_filter_add_bool(tmp_filter,
+ if (__check_disable_filter_exist(filter) == false)
+ pkgmgrinfo_appinfo_filter_add_bool(filter,
PMINFO_APPINFO_PROP_APP_DISABLE, false);
- ret = _appinfo_get_applications(uid, uid, locale, tmp_filter, flag, list);
+ ret = _appinfo_get_applications(uid, uid, locale, filter, flag, list);
if (ret == PMINFO_R_OK && uid != GLOBAL_USER)
ret = _appinfo_get_applications(GLOBAL_USER, uid, locale,
- tmp_filter, flag, list);
+ filter, flag, list);
if (ret != PMINFO_R_OK) {
g_hash_table_destroy(list);
free(locale);
- if (filter == NULL)
- pkgmgrinfo_pkginfo_filter_destroy(tmp_filter);
return ret;
}
g_hash_table_destroy(list);
free(locale);
- if (filter == NULL)
- pkgmgrinfo_pkginfo_filter_destroy(tmp_filter);
-
return PMINFO_R_OK;
}
API int pkgmgrinfo_appinfo_get_usr_installed_list(
pkgmgrinfo_app_list_cb app_func, uid_t uid, void *user_data)
{
+ int ret;
+ pkgmgrinfo_appinfo_filter_h filter;
+
if (app_func == NULL) {
LOGE("invalid parameter");
return PMINFO_R_EINVAL;
}
- return _appinfo_get_filtered_foreach_appinfo(uid, NULL,
+ /* create an empty filter */
+ ret = pkgmgrinfo_appinfo_filter_create(&filter);
+ if (ret != PMINFO_R_OK)
+ return ret;
+
+ ret = _appinfo_get_filtered_foreach_appinfo(uid, filter,
PMINFO_APPINFO_GET_ALL, app_func, user_data);
+
+ pkgmgrinfo_appinfo_filter_destroy(filter);
+
+ return ret;
}
API int pkgmgrinfo_appinfo_get_installed_list(pkgmgrinfo_app_list_cb app_func,
API int pkgmgrinfo_pkginfo_get_usr_list_full(pkgmgrinfo_pkg_list_cb pkg_list_cb,
int flag, void *user_data, uid_t uid)
{
+ int ret;
+ pkgmgrinfo_pkginfo_filter_h filter;
+
if (pkg_list_cb == NULL) {
LOGE("invalid parameter");
return PMINFO_R_EINVAL;
}
- return _pkginfo_get_filtered_foreach_pkginfo(uid, NULL, flag,
+ /* create an empty filter */
+ ret = pkgmgrinfo_pkginfo_filter_create(&filter);
+ if (ret != PMINFO_R_OK)
+ return ret;
+
+ ret = _pkginfo_get_filtered_foreach_pkginfo(uid, filter, flag,
pkg_list_cb, user_data);
+
+ pkgmgrinfo_pkginfo_filter_destroy(filter);
+
+ return ret;
}
API int pkgmgrinfo_pkginfo_get_list_full(pkgmgrinfo_pkg_list_cb pkg_list_cb,
API int pkgmgrinfo_pkginfo_get_usr_list(pkgmgrinfo_pkg_list_cb pkg_list_cb,
void *user_data, uid_t uid)
{
+ int ret;
+ pkgmgrinfo_pkginfo_filter_h filter;
+
if (pkg_list_cb == NULL) {
LOGE("invalid parameter");
return PMINFO_R_EINVAL;
}
- return _pkginfo_get_filtered_foreach_pkginfo(uid, NULL,
+ /* create an empty filter */
+ ret = pkgmgrinfo_pkginfo_filter_create(&filter);
+ if (ret != PMINFO_R_OK)
+ return ret;
+
+ ret = _pkginfo_get_filtered_foreach_pkginfo(uid, filter,
PMINFO_PKGINFO_GET_ALL, pkg_list_cb, user_data);
+
+ pkgmgrinfo_pkginfo_filter_destroy(filter);
+
+ return ret;
}
API int pkgmgrinfo_pkginfo_get_list(pkgmgrinfo_pkg_list_cb pkg_list_cb,