" LEFT OUTER JOIN package_privilege_info"
" ON ai.package=package_privilege_info.package ";
-int GetFilteredQuery(pkgmgrinfo_filter_x* filter, const char* locale,
+void GetFilteredQuery(pkgmgrinfo_filter_x* filter, const char* locale,
uid_t uid, std::string& query, std::list<std::string>& bind_params) {
int joined = 0;
char* condition = nullptr;
if (!filter)
- return PMINFO_R_OK;
+ return;
if (filter->cache_flag) {
joined = E_PMINFO_APPINFO_JOIN_LOCALIZED_INFO |
query = tmp_query + buf;
g_list_free_full(tmp_params, free);
-
- return PMINFO_R_OK;
}
bool __check_app_storage_status(pkgmgrinfo_filter_x* tmp_filter) {
is_check_storage = __check_app_storage_status(filter);
std::string constraint;
- int ret = GetFilteredQuery(filter, locale, uid, constraint, bind_params);
- if (ret != PMINFO_R_OK) {
- LOGE("Failed to get WHERE clause");
- return PMINFO_R_ERROR;
- }
+ GetFilteredQuery(filter, locale, uid, constraint, bind_params);
query += query_from_clause;
query += query_uid_info_clause;
return PMINFO_R_OK;
}
-int _get_filtered_query(pkgmgrinfo_filter_x *filter,
+void _get_filtered_query(pkgmgrinfo_filter_x *filter,
const std::string& locale, uid_t uid,
std::string& query, std::vector<std::string>& bind_params) {
if (!filter)
- return PMINFO_R_OK;
+ return;
int joined = 0;
if (filter->cache_flag) {
query = buf2 + buf;
g_list_free_full(tmp_params, free);
-
- return PMINFO_R_OK;
}
bool CheckPackageStorageStatus(pkgmgrinfo_filter_x* tmp_filter) {
static const char query_res_lib[] =
", (SELECT lib FROM package_res_info WHERE pi.package=package)";
static const char query_from_clause[] = " FROM package_info as pi";
- int ret = PMINFO_R_ERROR;
char* tmp_record = nullptr;
std::vector<std::string> bind_params;
bool is_check_storage = true;
query += query_from_clause;
std::string constraints;
- ret = _get_filtered_query(filter, locale, uid,
- constraints, bind_params);
- if (ret != PMINFO_R_OK) {
- LOGE("Failed to get WHERE clause");
- return PMINFO_R_EINVAL;
- }
+ _get_filtered_query(filter, locale, uid, constraints, bind_params);
if (!constraints.empty())
query += constraints;