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)
{
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()) {
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()) {
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;
}