From: Somin Kim Date: Wed, 26 Apr 2017 09:33:10 +0000 (+0900) Subject: [History] Deprecate context history data/filter & Added context_history_is_supported() X-Git-Tag: accepted/tizen/unified/20170608.185249~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F68%2F127168%2F6;p=platform%2Fcore%2Fapi%2Fcontext.git [History] Deprecate context history data/filter & Added context_history_is_supported() Change-Id: I77eaf31f802a04c3294e61484a702fb8cc012441 Signed-off-by: Somin Kim --- diff --git a/include/context_history.h b/include/context_history.h index 0c578ba..9d82c2a 100644 --- a/include/context_history.h +++ b/include/context_history.h @@ -18,7 +18,7 @@ #define __TIZEN_CONTEXT_HISTORY_H__ -#include +#include #ifdef __cplusplus extern "C" { @@ -65,36 +65,41 @@ extern "C" { #define CONTEXT_HISTORY_LAST_TIME "LastTime" /** - * @brief Definition for the attribute key denoting "hour of day". - * @details This can be used as a key of context_history_record_get_int(). + * @deprecated Deprecated since 4.0. + * @brief Definition for the attribute key denoting "hour of day". + * @details This can be used as a key of context_history_record_get_int(). * @since_tizen 2.4 */ #define CONTEXT_HISTORY_HOUR_OF_DAY "HourOfDay" /** - * @brief Definition for the attribute key denoting "audio jack status". - * @details This can be used as a key of context_history_record_get_int(). + * @deprecated Deprecated since 4.0. + * @brief Definition for the attribute key denoting "audio jack status". + * @details This can be used as a key of context_history_record_get_int(). * @since_tizen 2.4 */ #define CONTEXT_HISTORY_AUDIO_JACK "AudioJack" /** - * @brief Definition for the attribute key denoting "system volume". - * @details This can be used as a key of context_history_record_get_int(). + * @deprecated Deprecated since 4.0. + * @brief Definition for the attribute key denoting "system volume". + * @details This can be used as a key of context_history_record_get_int(). * @since_tizen 2.4 */ #define CONTEXT_HISTORY_SYSTEM_VOLUME "SystemVolume" /** - * @brief Definition for the attribute key denoting "media volume". - * @details This can be used as a key of context_history_record_get_int(). + * @deprecated Deprecated since 4.0. + * @brief Definition for the attribute key denoting "media volume". + * @details This can be used as a key of context_history_record_get_int(). * @since_tizen 2.4 */ #define CONTEXT_HISTORY_MEDIA_VOLUME "MediaVolume" /** - * @brief Definition for the attribute key denoting "address". - * @details This can be used as a key of context_history_record_get_string(). + * @deprecated Deprecated since 4.0. + * @brief Definition for the attribute key denoting "address". + * @details This can be used as a key of context_history_record_get_string(). * @since_tizen 2.4 */ #define CONTEXT_HISTORY_ADDRESS "Address" @@ -104,14 +109,14 @@ extern "C" { * @since_tizen 2.4 */ typedef enum { - CONTEXT_HISTORY_ERROR_NONE = TIZEN_ERROR_NONE, /**< Successful */ + CONTEXT_HISTORY_ERROR_NONE = TIZEN_ERROR_NONE, /**< Successful */ CONTEXT_HISTORY_ERROR_INVALID_PARAMETER = TIZEN_ERROR_INVALID_PARAMETER, /**< Invalid parameter */ CONTEXT_HISTORY_ERROR_PERMISSION_DENIED = TIZEN_ERROR_PERMISSION_DENIED, /**< Permission denied */ CONTEXT_HISTORY_ERROR_NOT_SUPPORTED = TIZEN_ERROR_NOT_SUPPORTED, /**< Not supported */ CONTEXT_HISTORY_ERROR_OUT_OF_MEMORY = TIZEN_ERROR_OUT_OF_MEMORY, /**< Memory allocation failed */ CONTEXT_HISTORY_ERROR_NO_DATA = TIZEN_ERROR_NO_DATA, /**< No Data */ - CONTEXT_HISTORY_ERROR_OUT_OF_RANGE = (TIZEN_ERROR_CONTEXT | 0x03), /**< Out of range */ - CONTEXT_HISTORY_ERROR_OPERATION_FAILED = (TIZEN_ERROR_CONTEXT | 0x04), /**< Operation failed */ + CONTEXT_HISTORY_ERROR_OUT_OF_RANGE = (TIZEN_ERROR_CONTEXT | 0x03), /**< Out of range */ + CONTEXT_HISTORY_ERROR_OPERATION_FAILED = (TIZEN_ERROR_CONTEXT | 0x04), /**< Operation failed */ } context_history_error_e; /** @@ -119,18 +124,28 @@ typedef enum { * @since_tizen 2.4 */ typedef enum { - CONTEXT_HISTORY_RECENTLY_USED_APP = 1, /**< Recently used application.@n Privilege : http://tizen.org/privilege/apphistory.read*/ - CONTEXT_HISTORY_FREQUENTLY_USED_APP, /**< Frequently used application.@n Privilege : http://tizen.org/privilege/apphistory.read*/ - CONTEXT_HISTORY_RARELY_USED_APP, /**< Rarely used application.@n Privilege : http://tizen.org/privilege/apphistory.read*/ - CONTEXT_HISTORY_PEAK_TIME_FOR_APP, /**< Peak time of application use activity.@n Privilege : http://tizen.org/privilege/apphistory.read*/ - CONTEXT_HISTORY_PEAK_TIME_FOR_MUSIC, /**< Peak time of music listening activity.@n Privilege : http://tizen.org/privilege/mediahistory.read*/ - CONTEXT_HISTORY_PEAK_TIME_FOR_VIDEO, /**< Peak time of video watching activity.@n Privilege : http://tizen.org/privilege/mediahistory.read*/ - CONTEXT_HISTORY_COMMON_SETTING_FOR_APP, /**< Common setting value of application use activity.@n Privilege : http://tizen.org/privilege/apphistory.read*/ - CONTEXT_HISTORY_COMMON_SETTING_FOR_MUSIC, /**< Common setting value of music listening activity.@n Privilege : http://tizen.org/privilege/mediahistory.read*/ - CONTEXT_HISTORY_COMMON_SETTING_FOR_VIDEO, /**< Common setting value of video watching activity.@n Privilege : http://tizen.org/privilege/mediahistory.read*/ - CONTEXT_HISTORY_FREQUENTLY_COMMUNICATED_ADDRESS, /**< Frequently communicated address.@n Privilege : http://tizen.org/privilege/callhistory.read*/ - CONTEXT_HISTORY_BATTERY_USAGE, /**< Per-app battery usage in percentage (Since 3.0) @n Privilege : http://tizen.org/privilege/apphistory.read*/ - CONTEXT_HISTORY_RECENT_BATTERY_USAGE, /**< Per-app battery usage in percentage since last charge (Since 3.0) @n Privilege : http://tizen.org/privilege/apphistory.read*/ + CONTEXT_HISTORY_RECENTLY_USED_APP = 1, /**< Recently used application @n Privilege : http://tizen.org/privilege/apphistory.read */ + CONTEXT_HISTORY_FREQUENTLY_USED_APP, /**< Frequently used application @n Privilege : http://tizen.org/privilege/apphistory.read */ + CONTEXT_HISTORY_RARELY_USED_APP, /**< Rarely used application (Deprecated since 4.0) + @n Privilege : http://tizen.org/privilege/apphistory.read */ + CONTEXT_HISTORY_PEAK_TIME_FOR_APP, /**< Peak time of application use activity (Deprecated since 4.0) + @n Privilege : http://tizen.org/privilege/apphistory.read */ + CONTEXT_HISTORY_PEAK_TIME_FOR_MUSIC, /**< Peak time of music listening activity (Deprecated since 4.0) + @n Privilege : http://tizen.org/privilege/mediahistory.read */ + CONTEXT_HISTORY_PEAK_TIME_FOR_VIDEO, /**< Peak time of video watching activity (Deprecated since 4.0) + @n Privilege : http://tizen.org/privilege/mediahistory.read */ + CONTEXT_HISTORY_COMMON_SETTING_FOR_APP, /**< Common setting value of application use activity (Deprecated since 4.0) + @n Privilege : http://tizen.org/privilege/apphistory.read */ + CONTEXT_HISTORY_COMMON_SETTING_FOR_MUSIC, /**< Common setting value of music listening activity (Deprecated since 4.0) + @n Privilege : http://tizen.org/privilege/mediahistory.read */ + CONTEXT_HISTORY_COMMON_SETTING_FOR_VIDEO, /**< Common setting value of video watching activity (Deprecated since 4.0) + @n Privilege : http://tizen.org/privilege/mediahistory.read */ + CONTEXT_HISTORY_FREQUENTLY_COMMUNICATED_ADDRESS, /**< Frequently communicated address (Deprecated since 4.0) + @n Privilege : http://tizen.org/privilege/callhistory.read */ + CONTEXT_HISTORY_BATTERY_USAGE, /**< Per-app battery usage in percentage (Since 3.0) + @n Privilege : http://tizen.org/privilege/apphistory.read */ + CONTEXT_HISTORY_RECENT_BATTERY_USAGE, /**< Per-app battery usage in percentage since last charge (Since 3.0) + @n Privilege : http://tizen.org/privilege/apphistory.read */ } context_history_data_e; /** @@ -138,25 +153,26 @@ typedef enum { * @since_tizen 2.4 */ typedef enum { - CONTEXT_HISTORY_FILTER_TIME_SPAN = 1, /**< Time span of data in days*/ - CONTEXT_HISTORY_FILTER_RESULT_SIZE, /**< Result size of data records*/ - CONTEXT_HISTORY_FILTER_APP_ID, /**< Application id*/ - CONTEXT_HISTORY_FILTER_DAY_OF_WEEK, /**< Weekdays, weekends*/ - CONTEXT_HISTORY_FILTER_START_TIME, /**< Start time of data in epoch time*/ - CONTEXT_HISTORY_FILTER_END_TIME, /**< End time of data in epoch time*/ - CONTEXT_HISTORY_FILTER_WIFI_BSSID, /**< Wi-Fi BSSID value*/ - CONTEXT_HISTORY_FILTER_AUDIO_JACK, /**< Audio jack status value*/ - CONTEXT_HISTORY_FILTER_COMMUNICATION_TYPE /**< Type of phone log*/ + CONTEXT_HISTORY_FILTER_TIME_SPAN = 1, /**< Time span of data in days */ + CONTEXT_HISTORY_FILTER_RESULT_SIZE, /**< Result size of data records */ + CONTEXT_HISTORY_FILTER_APP_ID, /**< Application id (Deprecated since 4.0) */ + CONTEXT_HISTORY_FILTER_DAY_OF_WEEK, /**< Weekdays, weekends (Deprecated since 4.0) */ + CONTEXT_HISTORY_FILTER_START_TIME, /**< Start time of data in epoch time */ + CONTEXT_HISTORY_FILTER_END_TIME, /**< End time of data in epoch time */ + CONTEXT_HISTORY_FILTER_WIFI_BSSID, /**< Wi-Fi BSSID value (Deprecated since 4.0) */ + CONTEXT_HISTORY_FILTER_AUDIO_JACK, /**< Audio jack status value */ + CONTEXT_HISTORY_FILTER_COMMUNICATION_TYPE /**< Type of phone log (Deprecated since 4.0) */ } context_history_filter_e; /** + * @deprecated Deprecated since 4.0. * @brief Enumeration for day of week filter. * @since_tizen 2.4 */ typedef enum { - CONTEXT_HISTORY_FILTER_DAY_OF_WEEK_WEEKDAYS = 1, /**< Includes only weekdays*/ - CONTEXT_HISTORY_FILTER_DAY_OF_WEEK_WEEKENDS, /**< Includes only weekends*/ - CONTEXT_HISTORY_FILTER_DAY_OF_WEEK_ALL /**< Includes all days*/ + CONTEXT_HISTORY_FILTER_DAY_OF_WEEK_WEEKDAYS = 1, /**< Includes only weekdays */ + CONTEXT_HISTORY_FILTER_DAY_OF_WEEK_WEEKENDS, /**< Includes only weekends */ + CONTEXT_HISTORY_FILTER_DAY_OF_WEEK_ALL /**< Includes all days */ } context_history_filter_day_of_week_e; /** @@ -164,18 +180,19 @@ typedef enum { * @since_tizen 2.4 */ typedef enum { - CONTEXT_HISTORY_FILTER_AUDIO_JACK_NOT_CONNECTED = 0, /**< Audio jack is not connected*/ - CONTEXT_HISTORY_FILTER_AUDIO_JACK_CONNECTED /**< Audio jack is connected*/ + CONTEXT_HISTORY_FILTER_AUDIO_JACK_NOT_CONNECTED = 0, /**< Audio jack is not connected */ + CONTEXT_HISTORY_FILTER_AUDIO_JACK_CONNECTED /**< Audio jack is connected */ } context_history_filter_audio_jack_e; /** + * @deprecated Deprecated since 4.0. * @brief Enumeration for log type filter. * @since_tizen 2.4 */ typedef enum { - CONTEXT_HISTORY_FILTER_COMMUNICATION_TYPE_CALL = 1, /**< Includes only call logs*/ - CONTEXT_HISTORY_FILTER_COMMUNICATION_TYPE_MESSAGE, /**< Includes only message logs*/ - CONTEXT_HISTORY_FILTER_COMMUNICATION_TYPE_ALL /**< Includes all logs*/ + CONTEXT_HISTORY_FILTER_COMMUNICATION_TYPE_CALL = 1, /**< Includes only call logs */ + CONTEXT_HISTORY_FILTER_COMMUNICATION_TYPE_MESSAGE, /**< Includes only message logs */ + CONTEXT_HISTORY_FILTER_COMMUNICATION_TYPE_ALL /**< Includes all logs */ } context_history_filter_communication_type_e; /** @@ -211,8 +228,8 @@ typedef struct _context_history_record_handle_s* context_history_record_h; * * @return @c 0 on success, otherwise a negative error value * @retval #CONTEXT_HISTORY_ERROR_NONE Successful - * @retval #CONTEXT_HISTORY_ERROR_INVALID_PARAMETER Invalid parameter - * @retval #CONTEXT_HISTORY_ERROR_OUT_OF_MEMORY Out of memory + * @retval #CONTEXT_HISTORY_ERROR_INVALID_PARAMETER Invalid parameter + * @retval #CONTEXT_HISTORY_ERROR_OUT_OF_MEMORY Out of memory * * @see context_history_destroy() */ @@ -228,7 +245,7 @@ int context_history_create(context_history_h* handle); * * @return @c 0 on success, otherwise a negative error value * @retval #CONTEXT_HISTORY_ERROR_NONE Successful - * @retval #CONTEXT_HISTORY_ERROR_INVALID_PARAMETER Invalid parameter + * @retval #CONTEXT_HISTORY_ERROR_INVALID_PARAMETER Invalid parameter * * @pre context_history_create() */ @@ -284,6 +301,7 @@ int context_history_filter_destroy(context_history_filter_h filter); int context_history_filter_set_int(context_history_filter_h filter, context_history_filter_e filter_type, int value); /** + * @deprecated Deprecated since 4.0. * @brief Sets a string to a filter. * @details This sets the value to a filter. * @since_tizen 2.4 @@ -299,7 +317,21 @@ int context_history_filter_set_int(context_history_filter_h filter, context_hist * @pre context_history_filter_create() * @see context_history_filter_set_int() */ -int context_history_filter_set_string(context_history_filter_h filter, context_history_filter_e filter_type, const char* value); +int context_history_filter_set_string(context_history_filter_h filter, context_history_filter_e filter_type, const char* value) TIZEN_DEPRECATED_API; + +/** + * @brief Checks whether a history data type is supported in the current device. + * @since_tizen 4.0 + * + * @param[in] data_type Type of history data + * @param[out] supported If supported, @c true, otherwise @c false + * + * @return @c 0 on success, otherwise a negative error value + * @retval #CONTEXT_TRIGGER_ERROR_NONE Successful + * @retval #CONTEXT_TRIGGER_ERROR_INVALID_PARAMETER Invalid parameter + * @retval #CONTEXT_TRIGGER_ERROR_OPERATION_FAILED Operation failed + */ +int context_history_is_supported(context_history_data_e data_type, bool* supported); /** * @brief Reads context statistics or patterns. @@ -319,11 +351,12 @@ int context_history_filter_set_string(context_history_filter_h filter, context_h * * @return @c 0 on success, otherwise a negative error value * @retval #CONTEXT_HISTORY_ERROR_NONE Successful - * @retval #CONTEXT_HISTORY_ERROR_INVALID_PARAMETER Invalid parameter - * @retval #CONTEXT_HISTORY_ERROR_PERMISSION_DENIED Permission denied + * @retval #CONTEXT_HISTORY_ERROR_INVALID_PARAMETER Invalid parameter + * @retval #CONTEXT_HISTORY_ERROR_PERMISSION_DENIED Permission denied + * @retval #CONTEXT_HISTORY_ERROR_NOT_SUPPORTED Unsupported history data * @retval #CONTEXT_HISTORY_ERROR_OPERATION_FAILED Operation failed - * @retval #CONTEXT_HISTORY_ERROR_OUT_OF_MEMORY Out of memory - * @retval #CONTEXT_HISTORY_ERROR_NO_DATA Requested data does not exist + * @retval #CONTEXT_HISTORY_ERROR_OUT_OF_MEMORY Out of memory + * @retval #CONTEXT_HISTORY_ERROR_NO_DATA Requested data does not exist * * @pre context_history_create() * @post context_history_list_destroy() @@ -339,7 +372,7 @@ int context_history_get_list(context_history_h handle, context_history_data_e da * * @return @c 0 on success, otherwise a negative error value * @retval #CONTEXT_HISTORY_ERROR_NONE Successful - * @retval #CONTEXT_HISTORY_ERROR_INVALID_PARAMETER Invalid parameter + * @retval #CONTEXT_HISTORY_ERROR_INVALID_PARAMETER Invalid parameter * @retval #CONTEXT_HISTORY_ERROR_OPERATION_FAILED Operation failed * * @pre context_history_get_list() @@ -359,9 +392,9 @@ int context_history_list_get_count(context_history_list_h list, int* count); * * @return @c 0 on success, otherwise a negative error value * @retval #CONTEXT_HISTORY_ERROR_NONE Successful - * @retval #CONTEXT_HISTORY_ERROR_INVALID_PARAMETER Invalid parameter + * @retval #CONTEXT_HISTORY_ERROR_INVALID_PARAMETER Invalid parameter * @retval #CONTEXT_HISTORY_ERROR_OPERATION_FAILED Operation failed - * @retval #CONTEXT_HISTORY_ERROR_OUT_OF_MEMORY Out of memory + * @retval #CONTEXT_HISTORY_ERROR_OUT_OF_MEMORY Out of memory * * @pre context_history_get_list() * @post context_history_record_destroy() @@ -376,7 +409,7 @@ int context_history_list_get_current(context_history_list_h list, context_histor * * @return @c 0 on success, otherwise a negative error value * @retval #CONTEXT_HISTORY_ERROR_NONE Successful - * @retval #CONTEXT_HISTORY_ERROR_INVALID_PARAMETER Invalid parameter + * @retval #CONTEXT_HISTORY_ERROR_INVALID_PARAMETER Invalid parameter * * @pre context_history_get_list() * @see context_history_list_get_count() @@ -392,8 +425,8 @@ int context_history_list_move_first(context_history_list_h list); * * @return @c 0 on success, otherwise a negative error value * @retval #CONTEXT_HISTORY_ERROR_NONE Successful - * @retval #CONTEXT_HISTORY_ERROR_INVALID_PARAMETER Invalid parameter - * @retval #CONTEXT_HISTORY_ERROR_NO_DATA Requested data does not exist + * @retval #CONTEXT_HISTORY_ERROR_INVALID_PARAMETER Invalid parameter + * @retval #CONTEXT_HISTORY_ERROR_NO_DATA Requested data does not exist * * @pre context_history_get_list() * @see context_history_list_get_count() @@ -409,7 +442,7 @@ int context_history_list_move_next(context_history_list_h list); * * @return @c 0 on success, otherwise a negative error value * @retval #CONTEXT_HISTORY_ERROR_NONE Successful - * @retval #CONTEXT_HISTORY_ERROR_INVALID_PARAMETER Invalid parameter + * @retval #CONTEXT_HISTORY_ERROR_INVALID_PARAMETER Invalid parameter * * @pre context_history_get_list() */ diff --git a/src/context_history.cpp b/src/context_history.cpp index 74e17d7..223319c 100644 --- a/src/context_history.cpp +++ b/src/context_history.cpp @@ -23,6 +23,8 @@ #include #include +#define HISTORY_DEPRECATED_DATA "DEPRECATION WARNING: This history data type is deprecated and will be removed from next release" +#define HISTORY_DEPRECATED_FILTER "DEPRECATION WARNING: This history filter is deprecated and will be removed from next release" #define TYPE_NUMERIC 0 #define TYPE_STRING 1 #define FILTER_KEY_LIMIT 10 @@ -62,6 +64,8 @@ static bool check_filter_data_int(context_history_filter_e filter_type, int val) static bool check_filter_data_string(context_history_filter_e filter_type, const char* val); 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_deprecated(context_history_filter_e filter_type); // life-cycle EXPORT_API int context_history_create(context_history_h* handle) @@ -104,6 +108,10 @@ EXPORT_API int context_history_filter_set_int(context_history_filter_h filter, c { ASSERT_NOT_NULL(filter); + 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 CONTEXT_HISTORY_ERROR_INVALID_PARAMETER; @@ -122,6 +130,11 @@ EXPORT_API int context_history_filter_set_string(context_history_filter_h filter ASSERT_NOT_NULL(filter); ASSERT_NOT_NULL(val); + _W("DEPRECATION WARNING: context_history_filter_set_string() is deprecated and will be removed from next release."); + 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 CONTEXT_HISTORY_ERROR_INVALID_PARAMETER; @@ -135,12 +148,31 @@ EXPORT_API int context_history_filter_set_string(context_history_filter_h filter return CONTEXT_HISTORY_ERROR_NONE; } +EXPORT_API int context_history_is_supported(context_history_data_e data_type, bool* supported) +{ + ASSERT_NOT_NULL(supported); + + if (history_is_deprecated(data_type)) { + _W(HISTORY_DEPRECATED_DATA); + } + + std::string data_type_str = convert_data_to_string(data_type); + if (data_type_str.empty()) { + return CONTEXT_HISTORY_ERROR_INVALID_PARAMETER; + } + + return ctx_history_is_supported(data_type_str.c_str(), supported); +} + EXPORT_API int context_history_get_list(context_history_h handle, context_history_data_e data_type, context_history_filter_h filter, context_history_list_h* list) { ASSERT_NOT_NULL(handle); ASSERT_NOT_NULL(list); *list = NULL; + if (history_is_deprecated(data_type)) { + _W(HISTORY_DEPRECATED_DATA); + } /*TODO: Boundary check for filter values has to be done*/ std::string data_type_str = convert_data_to_string(data_type); @@ -156,8 +188,6 @@ EXPORT_API int context_history_get_list(context_history_h handle, context_histor ASSERT_ALLOC(*list); int err = _ctx_history_query(data_type_str.c_str(), filter ? filter->jfilter.str().c_str() : "", &((*list)->cursor)); - if (err == TIZEN_ERROR_NOT_SUPPORTED) - err = CONTEXT_HISTORY_ERROR_NO_DATA; IF_FAIL_RETURN_TAG(err == E_NONE, err, _E, "Query failed"); return CONTEXT_HISTORY_ERROR_NONE; @@ -532,3 +562,39 @@ int __getIndexOf(context_history_record_h record, const std::string& key) } return -1; } + +bool history_is_deprecated(context_history_data_e data_type) +{ + bool ret = false; + switch (data_type) { + case CONTEXT_HISTORY_RARELY_USED_APP: + case CONTEXT_HISTORY_PEAK_TIME_FOR_APP: + case CONTEXT_HISTORY_PEAK_TIME_FOR_MUSIC: + case CONTEXT_HISTORY_PEAK_TIME_FOR_VIDEO: + case CONTEXT_HISTORY_COMMON_SETTING_FOR_APP: + case CONTEXT_HISTORY_COMMON_SETTING_FOR_MUSIC: + case CONTEXT_HISTORY_COMMON_SETTING_FOR_VIDEO: + case CONTEXT_HISTORY_FREQUENTLY_COMMUNICATED_ADDRESS: + ret = true; + break; + default: + break; + } + return ret; +} + +bool history_filter_is_deprecated(context_history_filter_e filter_type) +{ + bool ret = false; + switch (filter_type) { + 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; +}