fix filter api using appcontrol component 10/61310/9
authorJiwoong Im <jiwoong.im@samsung.com>
Mon, 7 Mar 2016 08:30:58 +0000 (17:30 +0900)
committerJiwoong Im <jiwoong.im@samsung.com>
Tue, 5 Apr 2016 02:35:34 +0000 (19:35 -0700)
Change-Id: I2c679846854578de4191d8d4ed038c179d9a50d1
Signed-off-by: Jiwoong Im <jiwoong.im@samsung.com>
src/pkgmgrinfo_appinfo.c
src/pkgmgrinfo_private.c

index 468ad8f..2f11839 100644 (file)
@@ -2794,9 +2794,6 @@ API int pkgmgrinfo_appinfo_filter_add_string(pkgmgrinfo_appinfo_filter_h handle,
                filter->list = g_slist_append(filter->list, (gpointer)node);
                break;
        case E_PMINFO_APPINFO_PROP_APP_CATEGORY:
-       case E_PMINFO_APPINFO_PROP_APP_OPERATION:
-       case E_PMINFO_APPINFO_PROP_APP_URI:
-       case E_PMINFO_APPINFO_PROP_APP_MIME:
                val = (char *)calloc(1, PKG_STRING_LEN_MAX);
                if (val == NULL) {
                        _LOGE("Out of Memory\n");
index 914a95a..b687716 100644 (file)
@@ -304,16 +304,13 @@ void __get_filter_condition(gpointer data, char **condition)
                snprintf(buf, sizeof(buf), "package_app_info.app_type='%s'", node->value);
                break;
        case E_PMINFO_APPINFO_PROP_APP_OPERATION:
-               snprintf(temp, sizeof(temp), "(%s)", node->value);
-               snprintf(buf, sizeof(buf), "package_app_app_control.app_control LIKE %s|%%|%%", temp);
+               snprintf(buf, sizeof(buf), "package_app_app_control.app_control LIKE '%s|%%%%|%%%%'", node->value);
                break;
        case E_PMINFO_APPINFO_PROP_APP_URI:
-               snprintf(temp, sizeof(temp), "(%s)", node->value);
-               snprintf(buf, sizeof(buf), "package_app_app_control.app_control LIKE %%|%s|%%", temp);
+               snprintf(buf, sizeof(buf), "package_app_app_control.app_control LIKE '%%%%|%s|%%%%'", node->value);
                break;
        case E_PMINFO_APPINFO_PROP_APP_MIME:
-               snprintf(temp, sizeof(temp), "(%s)", node->value);
-               snprintf(buf, sizeof(buf), "package_app_app_control.app_control LIKE %%|%%|%s", temp);
+               snprintf(buf, sizeof(buf), "package_app_app_control.app_control LIKE '%%%%|%%%%|%s'", node->value);
                break;
        case E_PMINFO_APPINFO_PROP_APP_CATEGORY:
                snprintf(temp, sizeof(temp), "(%s)", node->value);