[History] Modified context_history_filter_set_int/string() not to return NOT_SUPPORTE... 68/125668/3
authorSomin Kim <somin926.kim@samsung.com>
Tue, 18 Apr 2017 09:42:38 +0000 (18:42 +0900)
committerSomin Kim <somin926.kim@samsung.com>
Wed, 26 Apr 2017 04:35:29 +0000 (13:35 +0900)
Change-Id: I58f36cb7f3938ba3e271f0a1bef9d4689a8270d9
Signed-off-by: Somin Kim <somin926.kim@samsung.com>
src/context_history.cpp

index bf76835..6067270 100644 (file)
@@ -64,7 +64,7 @@ static bool check_filter_data_string(context_history_filter_e filter_type, const
 static bool check_invalid_filter(context_history_data_e data_type, context_history_filter_h filter);
 static int __getIndexOf(context_history_record_h record, const std::string& key);
 static bool history_is_deprecated(context_history_data_e data_type);
-static bool history_filter_is_supported(context_history_filter_e filter_type);
+static bool history_filter_is_deprecated(context_history_filter_e filter_type);
 
 // life-cycle
 EXPORT_API int context_history_create(context_history_h* handle)
@@ -107,7 +107,9 @@ EXPORT_API int context_history_filter_set_int(context_history_filter_h filter, c
 {
        ASSERT_NOT_NULL(filter);
 
-       IF_FAIL_RETURN_TAG(history_filter_is_supported(filter_type), CONTEXT_HISTORY_ERROR_NOT_SUPPORTED, _E, "Filter not supported");
+       if (history_filter_is_deprecated(filter_type)) {
+               _W(HISTORY_DEPRECATED_FILTER);
+       }
 
        std::string filter_str = convert_filter_to_string(filter_type);
        if (filter_str.empty()) {
@@ -128,8 +130,9 @@ EXPORT_API int context_history_filter_set_string(context_history_filter_h filter
        ASSERT_NOT_NULL(val);
 
        _W("DEPRECATION WARNING: context_history_filter_set_string() is deprecated and will be removed from next release.");
-
-       IF_FAIL_RETURN_TAG(history_filter_is_supported(filter_type), CONTEXT_HISTORY_ERROR_NOT_SUPPORTED, _E, "Filter not supported");
+       if (history_filter_is_deprecated(filter_type)) {
+               _W(HISTORY_DEPRECATED_FILTER);
+       }
 
        std::string filter_str = convert_filter_to_string(filter_type);
        if (filter_str.empty()) {
@@ -579,25 +582,18 @@ bool history_is_deprecated(context_history_data_e data_type)
        return ret;
 }
 
-bool history_filter_is_supported(context_history_filter_e filter_type)
+bool history_filter_is_deprecated(context_history_filter_e filter_type)
 {
        bool ret = false;
        switch (filter_type) {
-       case CONTEXT_HISTORY_FILTER_TIME_SPAN:
-       case CONTEXT_HISTORY_FILTER_RESULT_SIZE:
-       case CONTEXT_HISTORY_FILTER_START_TIME:
-       case CONTEXT_HISTORY_FILTER_END_TIME:
-       case CONTEXT_HISTORY_FILTER_AUDIO_JACK:
-               ret = true;
-               break;
        case CONTEXT_HISTORY_FILTER_APP_ID:
        case CONTEXT_HISTORY_FILTER_DAY_OF_WEEK:
        case CONTEXT_HISTORY_FILTER_WIFI_BSSID:
        case CONTEXT_HISTORY_FILTER_COMMUNICATION_TYPE:
+               ret = true;
                break;
        default:
                break;
        }
-
        return ret;
 }