pkgmgrinfo_basic_free_application((application_x *)data);
}
+static gint __app_disable_chk_func(gconstpointer data1, gconstpointer data2)
+{
+ pkgmgrinfo_node_x *node = (pkgmgrinfo_node_x *)data1;
+
+ if (node->prop == E_PMINFO_APPINFO_PROP_APP_DISABLE)
+ return 0;
+ else
+ return 1;
+}
+
+static bool __check_disable_filter_exist(pkgmgrinfo_filter_x *filter)
+{
+ GSList *link;
+
+ if (filter == NULL)
+ return false;
+
+ link = g_slist_find_custom(filter->list, NULL, __app_disable_chk_func);
+ if (link)
+ return true;
+
+ return false;
+}
+
static int __bind_params(sqlite3_stmt *stmt, GList *params)
{
GList *tmp_list = NULL;
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;
}
- ret = _appinfo_get_applications(uid, uid, locale, filter, flag, list);
+ 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,
+ PMINFO_APPINFO_PROP_APP_DISABLE, false);
+
+ ret = _appinfo_get_applications(uid, uid, locale, tmp_filter, flag, list);
if (ret == PMINFO_R_OK && uid != GLOBAL_USER)
ret = _appinfo_get_applications(GLOBAL_USER, uid, locale,
- filter, flag, list);
+ tmp_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;
}
pkgmgrinfo_pkginfo_filter_add_bool(tmp_filter,
PMINFO_PKGINFO_PROP_PACKAGE_DISABLE, false);
- ret = _pkginfo_get_packages(uid, locale, filter, flag, list);
+ ret = _pkginfo_get_packages(uid, locale, tmp_filter, flag, list);
if (ret == PMINFO_R_OK && uid != GLOBAL_USER)
- ret = _pkginfo_get_packages(GLOBAL_USER, locale, filter,
+ ret = _pkginfo_get_packages(GLOBAL_USER, locale, tmp_filter,
flag, list);
if (ret != PMINFO_R_OK) {