From 3cbe5f4f1ced6ee5f0043894e6220b27622d4837 Mon Sep 17 00:00:00 2001 From: Somin Kim Date: Tue, 18 Apr 2017 18:42:38 +0900 Subject: [PATCH] [History] Modified context_history_filter_set_int/string() not to return NOT_SUPPORTED error Change-Id: I58f36cb7f3938ba3e271f0a1bef9d4689a8270d9 Signed-off-by: Somin Kim --- src/context_history.cpp | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/src/context_history.cpp b/src/context_history.cpp index bf76835..6067270 100644 --- a/src/context_history.cpp +++ b/src/context_history.cpp @@ -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; } -- 2.7.4