From: Somin Kim Date: Thu, 11 May 2017 10:33:39 +0000 (+0900) Subject: [Trigger] Deprecate several contextual event/condition items X-Git-Tag: accepted/tizen/unified/20170608.185249~2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=6dd1df136113880f29b4ac7991d0bd324535405a;p=platform%2Fcore%2Fapi%2Fcontext.git [Trigger] Deprecate several contextual event/condition items Change-Id: Iab1fabe8e9afaf5b7114d4d46b99ce4523e25ea2 Signed-off-by: Somin Kim --- diff --git a/include/context_trigger.h b/include/context_trigger.h index d484625..777c859 100644 --- a/include/context_trigger.h +++ b/include/context_trigger.h @@ -90,10 +90,8 @@ extern "C" { /** * @brief Definition for the attribute key denoting "time of day". - * @details This can be used as a key of context_trigger_rule_entry_add_option_string(), - * or left operands of context_trigger_rule_entry_add_comparison_int().@n - * When being used as option, it is time interval of the day. For example, "13-15" denotes "from 1 PM to 3 PM". - * When being used with #CONTEXT_TRIGGER_EVENT_TIME or #CONTEXT_TRIGGER_CONDITION_TIME, it's unit is "minute", + * @details This can be used as left operands of context_trigger_rule_entry_add_comparison_int().@n + * When being used with #CONTEXT_TRIGGER_CONDITION_TIME, it's unit is "minute", * the valid range of the corresponding right operands is thus from 0 (12:00 AM) to 1439 (11:59 PM). * @since_tizen 2.4 */ @@ -101,8 +99,7 @@ extern "C" { /** * @brief Definition for the attribute key denoting "day of week". - * @details This can be used as a key of context_trigger_rule_entry_add_option_string(), - * or left operands of context_trigger_rule_entry_add_comparison_string().@n + * @details This can be used as left operands of context_trigger_rule_entry_add_comparison_string().@n * As the right operands of this attribute, one of the following values are allowed: * #CONTEXT_TRIGGER_MON, #CONTEXT_TRIGGER_TUE, #CONTEXT_TRIGGER_WED, #CONTEXT_TRIGGER_THU, #CONTEXT_TRIGGER_FRI, * #CONTEXT_TRIGGER_SAT, #CONTEXT_TRIGGER_SUN, #CONTEXT_TRIGGER_WEEKDAY, and #CONTEXT_TRIGGER_WEEKEND. @@ -162,9 +159,10 @@ extern "C" { #define CONTEXT_TRIGGER_STATE "State" /** - * @brief Definition for the attribute key denoting "BSSID". - * @details This can be used as left operands of context_trigger_rule_entry_add_comparison_string().@n - * See the programming guide to find available right operands. + * @deprecated Deprecated since 4.0. + * @brief Definition for the attribute key denoting "BSSID". + * @details This can be used as left operands of context_trigger_rule_entry_add_comparison_string().@n + * See the programming guide to find available right operands. * @since_tizen 2.4 */ #define CONTEXT_TRIGGER_BSSID "BSSID" @@ -194,9 +192,10 @@ extern "C" { #define CONTEXT_TRIGGER_ACCURACY "Accuracy" /** - * @brief Definition for the attribute key denoting "medium". - * @details This can be used as left operands of context_trigger_rule_entry_add_comparison_string().@n - * See the programming guide to find available right operands. + * @deprecated Deprecated since 4.0. + * @brief Definition for the attribute key denoting "medium". + * @details This can be used as left operands of context_trigger_rule_entry_add_comparison_string().@n + * See the programming guide to find available right operands. * @since_tizen 2.4 */ #define CONTEXT_TRIGGER_MEDIUM "Medium" @@ -210,34 +209,38 @@ extern "C" { #define CONTEXT_TRIGGER_PLACE_ID "PlaceId" /** - * @brief Definition for the attribute key denoting "application id". - * @details This can be used as a key of context_trigger_rule_entry_add_option_string().@n - * See the programming guide to find the corresponding trigger events. + * @deprecated Deprecated since 4.0. + * @brief Definition for the attribute key denoting "application id". + * @details This can be used as a key of context_trigger_rule_entry_add_option_string().@n + * See the programming guide to find the corresponding trigger events. * @since_tizen 2.4 */ #define CONTEXT_TRIGGER_APP_ID "AppId" /** - * @brief Definition for the attribute key denoting "address". - * @details This can be used as a key of context_trigger_rule_entry_add_option_string(), - * or context_trigger_rule_entry_add_comparison_string().@n - * See the programming guide and CAPI_CONTEXT_TRIGGER_MODULE_OPTION_FORMAT to find the corresponding items. + * @deprecated Deprecated since 4.0. + * @brief Definition for the attribute key denoting "address". + * @details This can be used as a key of context_trigger_rule_entry_add_option_string(), + * or context_trigger_rule_entry_add_comparison_string().@n + * See the programming guide and CAPI_CONTEXT_TRIGGER_MODULE_OPTION_FORMAT to find the corresponding items. * @since_tizen 2.4 */ #define CONTEXT_TRIGGER_ADDRESS "Address" /** - * @brief Definition for the attribute key denoting "rank". - * @details This can be used as left operands of context_trigger_rule_entry_add_comparison_int().@n - * See the programming guide to find available right operands. + * @deprecated Deprecated since 4.0. + * @brief Definition for the attribute key denoting "rank". + * @details This can be used as left operands of context_trigger_rule_entry_add_comparison_int().@n + * See the programming guide to find available right operands. * @since_tizen 2.4 */ #define CONTEXT_TRIGGER_RANK "Rank" /** - * @brief Definition for the attribute key denoting "total count". - * @details This can be used as left operands of context_trigger_rule_entry_add_comparison_int().@n - * See the programming guide to find available right operands. + * @deprecated Deprecated since 4.0. + * @brief Definition for the attribute key denoting "total count". + * @details This can be used as left operands of context_trigger_rule_entry_add_comparison_int().@n + * See the programming guide to find available right operands. * @since_tizen 2.4 */ #define CONTEXT_TRIGGER_TOTAL_COUNT "TotalCount" @@ -307,18 +310,16 @@ extern "C" { /** * @brief Definition for the attribute value denoting Weekdays. - * @details This can be used as a value of context_trigger_rule_entry_add_option_string() - * or right operands of context_trigger_rule_entry_add_comparison_string().@n - * See the programming guide to find the corresponding option keys or left operand attribute keys. + * @details This can be used as right operands of context_trigger_rule_entry_add_comparison_string().@n + * See the programming guide to find the corresponding left operand attribute keys. * @since_tizen 2.4 */ #define CONTEXT_TRIGGER_WEEKDAY "Weekday" /** * @brief Definition for the attribute value denoting Weekends. - * @details This can be used as a value of context_trigger_rule_entry_add_option_string() - * or right operands of context_trigger_rule_entry_add_comparison_string().@n - * See the programming guide to find the corresponding option keys or left operand attribute keys. + * @details This can be used as right operands of context_trigger_rule_entry_add_comparison_string().@n + * See the programming guide to find the corresponding left operand attribute keys. * @since_tizen 2.4 */ #define CONTEXT_TRIGGER_WEEKEND "Weekend" @@ -388,9 +389,10 @@ extern "C" { #define CONTEXT_TRIGGER_SEARCHING "Searching" /** - * @brief Definition for the attribute value denoting the "connecting" state. - * @details This can be used as right operands of context_trigger_rule_entry_add_comparison_string().@n - * See the programming guide to find the corresponding left operand attribute keys. + * @deprecated Deprecated since 4.0. + * @brief Definition for the attribute value denoting the "connecting" state. + * @details This can be used as right operands of context_trigger_rule_entry_add_comparison_string().@n + * See the programming guide to find the corresponding left operand attribute keys. * @since_tizen 2.4 */ #define CONTEXT_TRIGGER_CONNECTING "Connecting" @@ -412,25 +414,28 @@ extern "C" { #define CONTEXT_TRIGGER_UNCONNECTED "Unconnected" /** - * @brief Definition for the attribute value denoting the "idle" state. - * @details This can be used as right operands of context_trigger_rule_entry_add_comparison_string().@n - * See the programming guide to find the corresponding left operand attribute keys. + * @deprecated Deprecated since 4.0. + * @brief Definition for the attribute value denoting the "idle" state. + * @details This can be used as right operands of context_trigger_rule_entry_add_comparison_string().@n + * See the programming guide to find the corresponding left operand attribute keys. * @since_tizen 2.4 */ #define CONTEXT_TRIGGER_IDLE "Idle" /** - * @brief Definition for the attribute value denoting the "voice" type. - * @details This can be used as right operands of context_trigger_rule_entry_add_comparison_string().@n - * See the programming guide to find the corresponding left operand attribute keys. + * @deprecated Deprecated since 4.0. + * @brief Definition for the attribute value denoting the "voice" type. + * @details This can be used as right operands of context_trigger_rule_entry_add_comparison_string().@n + * See the programming guide to find the corresponding left operand attribute keys. * @since_tizen 2.4 */ #define CONTEXT_TRIGGER_VOICE "Voice" /** - * @brief Definition for the attribute value denoting the "video" type. - * @details This can be used as right operands of context_trigger_rule_entry_add_comparison_string().@n - * See the programming guide to find the corresponding left operand attribute keys. + * @deprecated Deprecated since 4.0. + * @brief Definition for the attribute value denoting the "video" type. + * @details This can be used as right operands of context_trigger_rule_entry_add_comparison_string().@n + * See the programming guide to find the corresponding left operand attribute keys. * @since_tizen 2.4 */ #define CONTEXT_TRIGGER_VIDEO "Video" @@ -452,33 +457,37 @@ extern "C" { #define CONTEXT_TRIGGER_BLUETOOTH "Bluetooth" /** - * @brief Definition for the attribute value denoting the "received" event. - * @details This can be used as right operands of context_trigger_rule_entry_add_comparison_string().@n - * See the programming guide to find the corresponding left operand attribute keys. + * @deprecated Deprecated since 4.0. + * @brief Definition for the attribute value denoting the "received" event. + * @details This can be used as right operands of context_trigger_rule_entry_add_comparison_string().@n + * See the programming guide to find the corresponding left operand attribute keys. * @since_tizen 2.4 */ #define CONTEXT_TRIGGER_RECEIVED "Received" /** - * @brief Definition for the attribute value denoting the "sent" event. - * @details This can be used as right operands of context_trigger_rule_entry_add_comparison_string().@n - * See the programming guide to find the corresponding left operand attribute keys. + * @deprecated Deprecated since 4.0. + * @brief Definition for the attribute value denoting the "sent" event. + * @details This can be used as right operands of context_trigger_rule_entry_add_comparison_string().@n + * See the programming guide to find the corresponding left operand attribute keys. * @since_tizen 2.4 */ #define CONTEXT_TRIGGER_SENT "Sent" /** - * @brief Definition for the attribute value denoting the "SMS" type. - * @details This can be used as right operands of context_trigger_rule_entry_add_comparison_string().@n - * See the programming guide to find the corresponding left operand attribute keys. + * @deprecated Deprecated since 4.0. + * @brief Definition for the attribute value denoting the "SMS" type. + * @details This can be used as right operands of context_trigger_rule_entry_add_comparison_string().@n + * See the programming guide to find the corresponding left operand attribute keys. * @since_tizen 2.4 */ #define CONTEXT_TRIGGER_SMS "SMS" /** - * @brief Definition for the attribute value denoting the "MMS" type. - * @details This can be used as right operands of context_trigger_rule_entry_add_comparison_string().@n - * See the programming guide to find the corresponding left operand attribute keys. + * @deprecated Deprecated since 4.0. + * @brief Definition for the attribute value denoting the "MMS" type. + * @details This can be used as right operands of context_trigger_rule_entry_add_comparison_string().@n + * See the programming guide to find the corresponding left operand attribute keys. * @since_tizen 2.4 */ #define CONTEXT_TRIGGER_MMS "MMS" @@ -556,17 +565,18 @@ typedef enum { * @since_tizen 2.4 */ typedef enum { - CONTEXT_TRIGGER_EVENT_TIME = 0x10001, /**< At certain times of day and days of week @n Privilege: http://tizen.org/privilege/alarm.set */ + CONTEXT_TRIGGER_EVENT_TIME = 0x10001, /**< At certain times of day and days of week (Deprecated since 4.0) + @n Privilege: http://tizen.org/privilege/alarm.set */ CONTEXT_TRIGGER_EVENT_BATTERY = 0x10100, /**< Battery level changed */ CONTEXT_TRIGGER_EVENT_CHARGER, /**< Charger connected/disconnected */ CONTEXT_TRIGGER_EVENT_GPS, /**< GPS state changed */ CONTEXT_TRIGGER_EVENT_HEADPHONE, /**< Headphone connected/disconnected */ CONTEXT_TRIGGER_EVENT_USB, /**< USB connected/disconnected */ CONTEXT_TRIGGER_EVENT_WIFI, /**< WiFi state changed @n Privilege: http://tizen.org/privilege/network.get */ - CONTEXT_TRIGGER_EVENT_POWER_SAVING_MODE = 0x10200, /**< Power saving mode enabled/disabled */ - CONTEXT_TRIGGER_EVENT_CALL = 0x10300, /**< Call state changed @n Privilege: http://tizen.org/privilege/telephony */ - CONTEXT_TRIGGER_EVENT_EMAIL, /**< Email sent/received */ - CONTEXT_TRIGGER_EVENT_MESSAGE, /**< Message sent/received @n Privilege: http://tizen.org/privilege/message.read */ + CONTEXT_TRIGGER_EVENT_POWER_SAVING_MODE = 0x10200, /**< Power saving mode enabled/disabled (Deprecated since 4.0) */ + CONTEXT_TRIGGER_EVENT_CALL = 0x10300, /**< Call state changed (Deprecated since 4.0) @n Privilege: http://tizen.org/privilege/telephony */ + CONTEXT_TRIGGER_EVENT_EMAIL, /**< Email sent/received (Deprecated since 4.0) */ + CONTEXT_TRIGGER_EVENT_MESSAGE, /**< Message sent/received (Deprecated since 4.0) @n Privilege: http://tizen.org/privilege/message.read */ CONTEXT_TRIGGER_EVENT_CONTACTS, /**< Contacts changed (Since 3.0) @n Privilege: http://tizen.org/privilege/contact.read */ CONTEXT_TRIGGER_EVENT_ACTIVITY_STATIONARY = 0x10400, /**< 'Stationary' activity detected */ CONTEXT_TRIGGER_EVENT_ACTIVITY_WALKING, /**< 'Walking' activity detected */ @@ -587,12 +597,16 @@ typedef enum { CONTEXT_TRIGGER_CONDITION_HEADPHONE, /**< Headphone connection */ CONTEXT_TRIGGER_CONDITION_USB, /**< USB connection */ CONTEXT_TRIGGER_CONDITION_WIFI, /**< WiFi state @n Privilege: http://tizen.org/privilege/network.get */ - CONTEXT_TRIGGER_CONDITION_POWER_SAVING_MODE = 0x20200, /**< Power saving mode setting */ - CONTEXT_TRIGGER_CONDITION_CALL = 0x20300, /**< Call state @n Privilege: http://tizen.org/privilege/telephony */ - CONTEXT_TRIGGER_CONDITION_APP_USE_FREQUENCY = 0x20600, /**< Frequency of app use @n Privilege: http://tizen.org/privilege/apphistory.read */ - CONTEXT_TRIGGER_CONDITION_COMMUNICATION_FREQUENCY, /**< Frequency of communication via call or message @n Privilege: http://tizen.org/privilege/callhistory.read */ - CONTEXT_TRIGGER_CONDITION_MUSIC_PLAYBACK_FREQUENCY, /**< Frequency of music playback @n Privilege: http://tizen.org/privilege/mediahistory.read */ - CONTEXT_TRIGGER_CONDITION_VIDEO_PLAYBACK_FREQUENCY, /**< Frequency of video playback @n Privilege: http://tizen.org/privilege/mediahistory.read */ + CONTEXT_TRIGGER_CONDITION_POWER_SAVING_MODE = 0x20200, /**< Power saving mode setting (Deprecated since 4.0) */ + CONTEXT_TRIGGER_CONDITION_CALL = 0x20300, /**< Call state (Deprecated since 4.0) @n Privilege: http://tizen.org/privilege/telephony */ + CONTEXT_TRIGGER_CONDITION_APP_USE_FREQUENCY = 0x20600, /**< Frequency of app use (Deprecated since 4.0) + @n Privilege: http://tizen.org/privilege/apphistory.read */ + CONTEXT_TRIGGER_CONDITION_COMMUNICATION_FREQUENCY, /**< Frequency of communication via call or message (Deprecated since 4.0) + @n Privilege: http://tizen.org/privilege/callhistory.read */ + CONTEXT_TRIGGER_CONDITION_MUSIC_PLAYBACK_FREQUENCY, /**< Frequency of music playback (Deprecated since 4.0) + @n Privilege: http://tizen.org/privilege/mediahistory.read */ + CONTEXT_TRIGGER_CONDITION_VIDEO_PLAYBACK_FREQUENCY, /**< Frequency of video playback (Deprecated since 4.0) + @n Privilege: http://tizen.org/privilege/mediahistory.read */ } context_trigger_condition_e; /** @@ -1012,6 +1026,7 @@ int context_trigger_rule_entry_destroy(context_trigger_rule_entry_h entry); int context_trigger_rule_entry_add_option_int(context_trigger_rule_entry_h entry, const char* option_key, int value); /** + * @deprecated Deprecated since 4.0. * @brief Sets a string type option to an event or condition entry. * @details See the programming guide to find available option keys for each event/condition item. * @since_tizen 2.4 @@ -1029,9 +1044,10 @@ int context_trigger_rule_entry_add_option_int(context_trigger_rule_entry_h entry * @see context_trigger_rule_entry_add_option() * @see context_trigger_rule_entry_add_option_int() */ -int context_trigger_rule_entry_add_option_string(context_trigger_rule_entry_h entry, const char* option_key, const char* value); +int context_trigger_rule_entry_add_option_string(context_trigger_rule_entry_h entry, const char* option_key, const char* value) TIZEN_DEPRECATED_API; /** + * @deprecated Deprecated since 4.0. * @brief Sets an option to a condition entry, which references an attribute that will be extracted from the event. * @details See the programming guide to find available option keys for each condition item. * @since_tizen 2.4 @@ -1049,7 +1065,7 @@ int context_trigger_rule_entry_add_option_string(context_trigger_rule_entry_h en * @see context_trigger_rule_entry_add_option_int() * @see context_trigger_rule_entry_add_option_string() */ -int context_trigger_rule_entry_add_option(context_trigger_rule_entry_h entry, const char* option_key, const char* event_data_key); +int context_trigger_rule_entry_add_option(context_trigger_rule_entry_h entry, const char* option_key, const char* event_data_key) TIZEN_DEPRECATED_API; /** * @brief Adds an attribute key to an entry. @@ -1126,6 +1142,7 @@ int context_trigger_rule_entry_add_comparison_int(context_trigger_rule_entry_h e int context_trigger_rule_entry_add_comparison_string(context_trigger_rule_entry_h entry, const char* key, const char* comp_operator, const char* value); /** + * @deprecated Deprecated since 4.0. * @brief Adds a comparison between an attribute of a condition and an attribute extracted from the event. * @details The key needs to be registered in advance, via context_trigger_rule_entry_add_key(). * @since_tizen 2.4 @@ -1146,7 +1163,7 @@ int context_trigger_rule_entry_add_comparison_string(context_trigger_rule_entry_ * @see context_trigger_rule_entry_add_comparison_int() * @see context_trigger_rule_entry_add_comparison_string() */ -int context_trigger_rule_entry_add_comparison(context_trigger_rule_entry_h entry, const char* key, const char* comp_operator, const char* event_data_key); +int context_trigger_rule_entry_add_comparison(context_trigger_rule_entry_h entry, const char* key, const char* comp_operator, const char* event_data_key) TIZEN_DEPRECATED_API; /** * @brief Defines a custom contextual data item with its template. diff --git a/src/context_trigger.cpp b/src/context_trigger.cpp index dbfee68..e737384 100644 --- a/src/context_trigger.cpp +++ b/src/context_trigger.cpp @@ -32,6 +32,10 @@ #include "rule_validator.h" #include "rule_util.h" +#define TRIGGER_DEPRECATED_FUNCTION_MSG "DEPRECATION WARNING: %s is deprecated and will be removed from next release." +#define TRIGGER_DEPRECATED_EVENT_MSG "DEPRECATION WARNING: This event is deprecated and will be removed from next release." +#define TRIGGER_DEPRECATED_CONDITION_MSG "DEPRECATION WARNING: This condition is deprecated and will be removed from next release." + //#define DOUBLE_PRECISION 2 #define TYPE_EVENT 1 #define TYPE_CONDITION 2 @@ -52,6 +56,8 @@ static std::string convert_event_to_string(context_trigger_event_e item); static std::string convert_condition_to_string(context_trigger_condition_e item); static std::string convert_logical_type_to_string(context_trigger_logical_type_e logical_type); static std::string get_custom_item_subject(const char* provider, const char* item); +static bool event_is_deprecated(context_trigger_event_e item); +static bool condition_is_deprecated(context_trigger_condition_e item); //static std::string int_to_string(int value); //static std::string double_to_string(int value); @@ -539,6 +545,10 @@ SO_EXPORT int context_trigger_rule_event_create(context_trigger_event_e event_it _D("BEGIN"); ASSERT_NOT_NULL(entry); + if (event_is_deprecated(event_item)) { + _W(TRIGGER_DEPRECATED_EVENT_MSG); + } + std::string eitem_str = convert_event_to_string(event_item); if (eitem_str.empty()) { return CONTEXT_TRIGGER_ERROR_INVALID_PARAMETER; @@ -592,6 +602,10 @@ SO_EXPORT int context_trigger_rule_event_is_supported(context_trigger_event_e ev _D("BEGIN"); ASSERT_NOT_NULL(supported); + if (event_is_deprecated(event_item)) { + _W(TRIGGER_DEPRECATED_EVENT_MSG); + } + *supported = false; std::string eitem_str = convert_event_to_string(event_item); @@ -616,6 +630,10 @@ SO_EXPORT int context_trigger_rule_condition_create(context_trigger_condition_e _D("BEGIN"); ASSERT_NOT_NULL(entry); + if (condition_is_deprecated(condition_item)) { + _W(TRIGGER_DEPRECATED_CONDITION_MSG); + } + std::string citem_str = convert_condition_to_string(condition_item); if (citem_str.empty()) { return CONTEXT_TRIGGER_ERROR_INVALID_PARAMETER; @@ -667,6 +685,10 @@ SO_EXPORT int context_trigger_rule_condition_is_supported(context_trigger_condit _D("BEGIN"); ASSERT_NOT_NULL(supported); + if (condition_is_deprecated(condition_item)) { + _W(TRIGGER_DEPRECATED_CONDITION_MSG); + } + *supported = false; std::string citem_str = convert_condition_to_string(condition_item); @@ -716,6 +738,7 @@ SO_EXPORT int context_trigger_rule_entry_add_option_int(context_trigger_rule_ent SO_EXPORT int context_trigger_rule_entry_add_option_string(context_trigger_rule_entry_h entry, const char* option_key, const char* value) { _D("BEGIN"); + _W(TRIGGER_DEPRECATED_FUNCTION_MSG, __FUNCTION__); ASSERT_NOT_NULL(entry && option_key && value); bool ret = true; @@ -734,6 +757,7 @@ SO_EXPORT int context_trigger_rule_entry_add_option_string(context_trigger_rule_ SO_EXPORT int context_trigger_rule_entry_add_option(context_trigger_rule_entry_h entry, const char* option_key, const char* event_data_key) { _D("BEGIN"); + _W(TRIGGER_DEPRECATED_FUNCTION_MSG, __FUNCTION__); ASSERT_NOT_NULL(entry && option_key && event_data_key); // Err: Only conditin can reference data from event @@ -856,6 +880,7 @@ static int context_trigger_rule_entry_add_comparison_int_internal(context_trigge SO_EXPORT int context_trigger_rule_entry_add_comparison(context_trigger_rule_entry_h entry, const char* key, const char* op, const char* event_data_key) { _D("BEGIN"); + _W(TRIGGER_DEPRECATED_FUNCTION_MSG, __FUNCTION__); ASSERT_NOT_NULL(entry && key && op && event_data_key); // Err: Only condition can reference data from event @@ -1127,6 +1152,41 @@ std::string get_custom_item_subject(const char* provider, const char* item) return subject_name; } +bool event_is_deprecated(context_trigger_event_e item) +{ + bool ret = false; + switch (item) { + case CONTEXT_TRIGGER_EVENT_TIME: + case CONTEXT_TRIGGER_EVENT_POWER_SAVING_MODE: + case CONTEXT_TRIGGER_EVENT_CALL: + case CONTEXT_TRIGGER_EVENT_EMAIL: + case CONTEXT_TRIGGER_EVENT_MESSAGE: + ret = true; + break; + default: + break; + } + return ret; +} + +bool condition_is_deprecated(context_trigger_condition_e item) +{ + bool ret = false; + switch (item) { + case CONTEXT_TRIGGER_CONDITION_POWER_SAVING_MODE: + case CONTEXT_TRIGGER_CONDITION_CALL: + case CONTEXT_TRIGGER_CONDITION_APP_USE_FREQUENCY: + case CONTEXT_TRIGGER_CONDITION_COMMUNICATION_FREQUENCY: + case CONTEXT_TRIGGER_CONDITION_MUSIC_PLAYBACK_FREQUENCY: + case CONTEXT_TRIGGER_CONDITION_VIDEO_PLAYBACK_FREQUENCY: + ret = true; + break; + default: + break; + } + return ret; +} + /* std::string int_to_string(int value) {