Fix appinfo to check additional db
[platform/core/appfw/pkgmgr-info.git] / src / pkgmgrinfo_pkginfo.c
index 5add4b0..5c0792c 100644 (file)
@@ -220,7 +220,7 @@ static const char join_privilege_info[] =
        "  ON pi.package=package_privilege_info.package";
 
 static int _get_filtered_query(pkgmgrinfo_filter_x *filter,
-               const char *locale, char **query, GList **bind_params)
+               const char *locale, uid_t uid, char **query, GList **bind_params)
 {
        int joined = 0;
        char buf[MAX_QUERY_LEN] = { '\0' };
@@ -235,7 +235,7 @@ static int _get_filtered_query(pkgmgrinfo_filter_x *filter,
        len += strlen(" WHERE 1=1 ");
        strncat(buf, " WHERE 1=1 ", MAX_QUERY_LEN - len - 1);
        for (list = filter->list; list; list = list->next) {
-               joined |= __get_filter_condition(list->data, &condition,
+               joined |= __get_filter_condition(list->data, uid, &condition,
                                bind_params);
                if (condition == NULL)
                        continue;
@@ -419,7 +419,7 @@ static int _pkginfo_get_packages(uid_t uid, const char *locale,
        strncat(query, query_from_clause, MAX_QUERY_LEN - query_len - 1);
        query_len += strlen(query_from_clause);
 
-       ret = _get_filtered_query(tmp_filter, locale, &constraints, &bind_params);
+       ret = _get_filtered_query(tmp_filter, locale, uid, &constraints, &bind_params);
        if (ret != PMINFO_R_OK) {
                LOGE("Failed to get WHERE clause");
                goto catch;