* @retval #CONTEXT_TRIGGER_ERROR_NONE Successful
* @retval #CONTEXT_TRIGGER_ERROR_INVALID_PARAMETER Invalid parameter
* @retval #CONTEXT_TRIGGER_ERROR_PERMISSION_DENIED Permission denied
- * @retval #CONTEXT_TRIGGER_ERROR_NOT_SUPPORTED Unsupported event/condition contained
+ * @retval #CONTEXT_TRIGGER_ERROR_NOT_SUPPORTED Not supported
* @retval #CONTEXT_TRIGGER_ERROR_OUT_OF_MEMORY Out of memory
* @retval #CONTEXT_TRIGGER_ERROR_OPERATION_FAILED Operation failed
* @retval #CONTEXT_TRIGGER_ERROR_INVALID_RULE Invalid rule
* @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_NOT_SUPPORTED Unsupported event/condition contained
+ * @retval #CONTEXT_TRIGGER_ERROR_NOT_SUPPORTED Not supported
* @retval #CONTEXT_TRIGGER_ERROR_OUT_OF_MEMORY Out of memory
* @retval #CONTEXT_TRIGGER_ERROR_OPERATION_FAILED Operation failed
* @retval #CONTEXT_TRIGGER_ERROR_RULE_ENABLED Rule is enabled already
* @retval #CONTEXT_TRIGGER_ERROR_NONE Successful
* @retval #CONTEXT_TRIGGER_ERROR_INVALID_PARAMETER Invalid parameter
* @retval #CONTEXT_TRIGGER_ERROR_OUT_OF_MEMORY Out of memory
+ * @retval #CONTEXT_TRIGGER_ERROR_NOT_SUPPORTED Not supported
* @retval #CONTEXT_TRIGGER_ERROR_OPERATION_FAILED Operation failed
* @retval #CONTEXT_TRIGGER_ERROR_RULE_NOT_ENABLED Rule is not enabled
* @retval #CONTEXT_TRIGGER_ERROR_RULE_NOT_EXIST Rule does not exist
* @retval #CONTEXT_TRIGGER_ERROR_NONE Successful
* @retval #CONTEXT_TRIGGER_ERROR_INVALID_PARAMETER Invalid parameter
* @retval #CONTEXT_TRIGGER_ERROR_OUT_OF_MEMORY Out of memory
+ * @retval #CONTEXT_TRIGGER_ERROR_NOT_SUPPORTED Not supported
* @retval #CONTEXT_TRIGGER_ERROR_OPERATION_FAILED Operation failed
*
*/
* @retval #CONTEXT_TRIGGER_ERROR_NONE Successful
* @retval #CONTEXT_TRIGGER_ERROR_INVALID_PARAMETER Invalid parameter
* @retval #CONTEXT_TRIGGER_ERROR_OUT_OF_MEMORY Out of memory
+ * @retval #CONTEXT_TRIGGER_ERROR_NOT_SUPPORTED Not supported
* @retval #CONTEXT_TRIGGER_ERROR_OPERATION_FAILED Operation failed
* @retval #CONTEXT_TRIGGER_ERROR_RULE_NOT_EXIST Rule does not exist
*/
* @retval #CONTEXT_TRIGGER_ERROR_NONE Successful
* @retval #CONTEXT_TRIGGER_ERROR_INVALID_PARAMETER Invalid parameter
* @retval #CONTEXT_TRIGGER_ERROR_OUT_OF_MEMORY Memory allocation failed
+ * @retval #CONTEXT_TRIGGER_ERROR_NOT_SUPPORTED Not supported
*
* @see context_trigger_rule_destroy()
*/
* @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_NOT_SUPPORTED Not supported
*
* @pre context_trigger_rule_create()
* @see context_trigger_get_rule_by_id()
* @retval #CONTEXT_TRIGGER_ERROR_NONE Successful
* @retval #CONTEXT_TRIGGER_ERROR_INVALID_PARAMETER Invalid parameter
* @retval #CONTEXT_TRIGGER_ERROR_OUT_OF_MEMORY Out of memory
+ * @retval #CONTEXT_TRIGGER_ERROR_NOT_SUPPORTED Not supported
* @retval #CONTEXT_TRIGGER_ERROR_OPERATION_FAILED Operation failed
* @retval #CONTEXT_TRIGGER_ERROR_INVALID_RULE Invalid rule
*/
* @retval #CONTEXT_TRIGGER_ERROR_INVALID_PARAMETER Invalid parameter
* @retval #CONTEXT_TRIGGER_ERROR_PERMISSION_DENIED Permission denied
* @retval #CONTEXT_TRIGGER_ERROR_OUT_OF_MEMORY Out of memory
+ * @retval #CONTEXT_TRIGGER_ERROR_NOT_SUPPORTED Not supported
* @retval #CONTEXT_TRIGGER_ERROR_OPERATION_FAILED Operation failed
* @retval #CONTEXT_TRIGGER_ERROR_INVALID_RULE Invalid rule
*/
* @retval #CONTEXT_TRIGGER_ERROR_INVALID_PARAMETER Invalid parameter
* @retval #CONTEXT_TRIGGER_ERROR_PERMISSION_DENIED Permission denied
* @retval #CONTEXT_TRIGGER_ERROR_OUT_OF_MEMORY Out of memory
+ * @retval #CONTEXT_TRIGGER_ERROR_NOT_SUPPORTED Not supported
* @retval #CONTEXT_TRIGGER_ERROR_OPERATION_FAILED Operation failed
* @retval #CONTEXT_TRIGGER_ERROR_INVALID_RULE Invalid rule
*/
* @retval #CONTEXT_TRIGGER_ERROR_NONE Successful
* @retval #CONTEXT_TRIGGER_ERROR_INVALID_PARAMETER Invalid parameter
* @retval #CONTEXT_TRIGGER_ERROR_OUT_OF_MEMORY Out of memory
+ * @retval #CONTEXT_TRIGGER_ERROR_NOT_SUPPORTED Not supported
* @retval #CONTEXT_TRIGGER_ERROR_OPERATION_FAILED Operation failed
*
* @see context_trigger_rule_get_description()
* @retval #CONTEXT_TRIGGER_ERROR_NONE Successful
* @retval #CONTEXT_TRIGGER_ERROR_INVALID_PARAMETER Invalid parameter
* @retval #CONTEXT_TRIGGER_ERROR_OUT_OF_MEMORY Out of memory
+ * @retval #CONTEXT_TRIGGER_ERROR_NOT_SUPPORTED Not supported
* @retval #CONTEXT_TRIGGER_ERROR_OPERATION_FAILED Operation failed
*
* @see context_trigger_rule_set_description()
* @retval #CONTEXT_TRIGGER_ERROR_NONE Successful
* @retval #CONTEXT_TRIGGER_ERROR_INVALID_PARAMETER Invalid parameter
* @retval #CONTEXT_TRIGGER_ERROR_OUT_OF_MEMORY Memory allocation failed
- * @retval #CONTEXT_TRIGGER_ERROR_NOT_SUPPORTED Unsupported event contained
+ * @retval #CONTEXT_TRIGGER_ERROR_NOT_SUPPORTED Not supported
*
* @see context_trigger_rule_entry_destroy()
*/
* @retval #CONTEXT_TRIGGER_ERROR_NONE Successful
* @retval #CONTEXT_TRIGGER_ERROR_INVALID_PARAMETER Invalid parameter
* @retval #CONTEXT_TRIGGER_ERROR_OPERATION_FAILED Operation failed
+ * @retval #CONTEXT_TRIGGER_ERROR_NOT_SUPPORTED Not supported
*/
int context_trigger_rule_event_is_supported(context_trigger_event_e event_item, bool* supported);
* @retval #CONTEXT_TRIGGER_ERROR_NONE Successful
* @retval #CONTEXT_TRIGGER_ERROR_INVALID_PARAMETER Invalid parameter
* @retval #CONTEXT_TRIGGER_ERROR_OUT_OF_MEMORY Memory allocation failed
- * @retval #CONTEXT_TRIGGER_ERROR_NOT_SUPPORTED Unsupported condition contained
+ * @retval #CONTEXT_TRIGGER_ERROR_NOT_SUPPORTED Not supported
*
* @see context_trigger_rule_entry_destroy()
*/
* @retval #CONTEXT_TRIGGER_ERROR_NONE Successful
* @retval #CONTEXT_TRIGGER_ERROR_INVALID_PARAMETER Invalid parameter
* @retval #CONTEXT_TRIGGER_ERROR_OPERATION_FAILED Operation failed
+ * @retval #CONTEXT_TRIGGER_ERROR_NOT_SUPPORTED Not supported
*/
int context_trigger_rule_condition_is_supported(context_trigger_condition_e condition_item, bool* supported);
* @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_NOT_SUPPORTED Not supported
*
* @pre context_trigger_rule_event_create()
* @pre context_trigger_rule_condition_create()
* @retval #CONTEXT_TRIGGER_ERROR_NONE Successful
* @retval #CONTEXT_TRIGGER_ERROR_INVALID_PARAMETER Invalid parameter
* @retval #CONTEXT_TRIGGER_ERROR_OUT_OF_MEMORY Out of memory
+ * @retval #CONTEXT_TRIGGER_ERROR_NOT_SUPPORTED Not supported
* @retval #CONTEXT_TRIGGER_ERROR_INVALID_RULE Invalid rule
*
* @see context_trigger_rule_entry_add_option()
* @retval #CONTEXT_TRIGGER_ERROR_NONE Successful
* @retval #CONTEXT_TRIGGER_ERROR_INVALID_PARAMETER Invalid parameter
* @retval #CONTEXT_TRIGGER_ERROR_OUT_OF_MEMORY Out of memory
+ * @retval #CONTEXT_TRIGGER_ERROR_NOT_SUPPORTED Not supported
* @retval #CONTEXT_TRIGGER_ERROR_INVALID_RULE Invalid rule
*
* @see context_trigger_rule_entry_add_option()
* @retval #CONTEXT_TRIGGER_ERROR_NONE Successful
* @retval #CONTEXT_TRIGGER_ERROR_INVALID_PARAMETER Invalid parameter
* @retval #CONTEXT_TRIGGER_ERROR_OUT_OF_MEMORY Out of memory
+ * @retval #CONTEXT_TRIGGER_ERROR_NOT_SUPPORTED Not supported
* @retval #CONTEXT_TRIGGER_ERROR_INVALID_RULE Invalid rule
*
* @see context_trigger_rule_entry_add_option_int()
* @retval #CONTEXT_TRIGGER_ERROR_NONE Successful
* @retval #CONTEXT_TRIGGER_ERROR_INVALID_PARAMETER Invalid parameter
* @retval #CONTEXT_TRIGGER_ERROR_OUT_OF_MEMORY Out of memory
+ * @retval #CONTEXT_TRIGGER_ERROR_NOT_SUPPORTED Not supported
* @retval #CONTEXT_TRIGGER_ERROR_INVALID_RULE Invalid rule
*
* @post context_trigger_rule_entry_add_comparison()
* @retval #CONTEXT_TRIGGER_ERROR_NONE Successful
* @retval #CONTEXT_TRIGGER_ERROR_INVALID_PARAMETER Invalid parameter
* @retval #CONTEXT_TRIGGER_ERROR_OUT_OF_MEMORY Out of memory
+ * @retval #CONTEXT_TRIGGER_ERROR_NOT_SUPPORTED Not supported
* @retval #CONTEXT_TRIGGER_ERROR_NO_DATA The key was not added in the entry
* @retval #CONTEXT_TRIGGER_ERROR_INVALID_RULE Invalid rule
*
* @retval #CONTEXT_TRIGGER_ERROR_NONE Successful
* @retval #CONTEXT_TRIGGER_ERROR_INVALID_PARAMETER Invalid parameter
* @retval #CONTEXT_TRIGGER_ERROR_OUT_OF_MEMORY Out of memory
+ * @retval #CONTEXT_TRIGGER_ERROR_NOT_SUPPORTED Not supported
* @retval #CONTEXT_TRIGGER_ERROR_NO_DATA The key was not added in the entry
* @retval #CONTEXT_TRIGGER_ERROR_INVALID_RULE Invalid rule
*
* @retval #CONTEXT_TRIGGER_ERROR_NONE Successful
* @retval #CONTEXT_TRIGGER_ERROR_INVALID_PARAMETER Invalid parameter
* @retval #CONTEXT_TRIGGER_ERROR_OUT_OF_MEMORY Out of memory
+ * @retval #CONTEXT_TRIGGER_ERROR_NOT_SUPPORTED Not supported
* @retval #CONTEXT_TRIGGER_ERROR_NO_DATA The key was not added in the entry
* @retval #CONTEXT_TRIGGER_ERROR_INVALID_RULE Invalid rule
*
* @retval #CONTEXT_TRIGGER_ERROR_NONE Successful
* @retval #CONTEXT_TRIGGER_ERROR_INVALID_PARAMETER Invalid parameter
* @retval #CONTEXT_TRIGGER_ERROR_OUT_OF_MEMORY Out of memory
+ * @retval #CONTEXT_TRIGGER_ERROR_NOT_SUPPORTED Not supported
* @retval #CONTEXT_TRIGGER_ERROR_OPERATION_FAILED Operation failed
* @retval #CONTEXT_TRIGGER_ERROR_DATA_EXIST Data exist
* @retval #CONTEXT_TRIGGER_ERROR_INVALID_DATA Invalid data
* @retval #CONTEXT_TRIGGER_ERROR_NONE Successful
* @retval #CONTEXT_TRIGGER_ERROR_INVALID_PARAMETER Invalid parameter
* @retval #CONTEXT_TRIGGER_ERROR_OPERATION_FAILED Operation failed
- * @retval #CONTEXT_TRIGGER_ERROR_NOT_SUPPORTED Unsupported event/condition item
+ * @retval #CONTEXT_TRIGGER_ERROR_NOT_SUPPORTED Not supported
*
* @see context_trigger_custom_register()
*/
* @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_NOT_SUPPORTED Unsupported event/condition contained
+ * @retval #CONTEXT_TRIGGER_ERROR_NOT_SUPPORTED Not supported
* @retval #CONTEXT_TRIGGER_ERROR_INVALID_DATA Invalid data
*/
int context_trigger_custom_publish(const char* name, const char* fact);
* @retval #CONTEXT_TRIGGER_ERROR_NONE Successful
* @retval #CONTEXT_TRIGGER_ERROR_INVALID_PARAMETER Invalid parameter
* @retval #CONTEXT_TRIGGER_ERROR_OUT_OF_MEMORY Memory allocation failed
- * @retval #CONTEXT_TRIGGER_ERROR_NOT_SUPPORTED Unsupported event contained
+ * @retval #CONTEXT_TRIGGER_ERROR_NOT_SUPPORTED Not supported
*
* @see context_trigger_rule_event_create()
* @see context_trigger_rule_entry_destroy()
* @retval #CONTEXT_TRIGGER_ERROR_NONE Successful
* @retval #CONTEXT_TRIGGER_ERROR_INVALID_PARAMETER Invalid parameter
* @retval #CONTEXT_TRIGGER_ERROR_OUT_OF_MEMORY Memory allocation failed
- * @retval #CONTEXT_TRIGGER_ERROR_NOT_SUPPORTED Unsupported condition contained
+ * @retval #CONTEXT_TRIGGER_ERROR_NOT_SUPPORTED Not supported
*
* @see context_trigger_rule_condition_create()
* @see context_trigger_rule_entry_destroy()
#include <app_control_internal.h>
#include <aul.h>
#include <pkgmgr-info.h>
+#include <system_info.h>
#include <ContextTypes.h>
#include <SharedUtil.h>
#define PKG_ID_LENGTH 128
+#define CONTEXT_TRIGGER_FEATURE "http://tizen.org/feature/contextual_trigger"
+#define CHECK_CONTEXT_TRIGGER_SUPPORTED(feature_name) \
+ do { \
+ bool is_supported = false; \
+ if (!system_info_get_platform_bool(feature_name, &is_supported)) { \
+ if (!is_supported) { \
+ _E("[%s] feature is disabled", feature_name); \
+ return CONTEXT_TRIGGER_ERROR_NOT_SUPPORTED; \
+ } \
+ } \
+ } while (0)
+
enum EntryCategory {
CATEGORY_EVENT = 1,
CATEGORY_CONDITION = 2
EXPORT_API int context_trigger_add_rule(context_trigger_rule_h rule, int* rule_id)
{
INIT_SCHED;
+ CHECK_CONTEXT_TRIGGER_SUPPORTED(CONTEXT_TRIGGER_FEATURE);
ASSERT_NOT_NULL(rule && rule_id);
int err = ctx_sched_add_job(SCHED, rule->job, rule_id);
EXPORT_API int context_trigger_remove_rule(int rule_id)
{
+ CHECK_CONTEXT_TRIGGER_SUPPORTED(CONTEXT_TRIGGER_FEATURE);
INIT_SCHED;
if (rule_id <= 0)
return CONTEXT_TRIGGER_ERROR_INVALID_PARAMETER;
EXPORT_API int context_trigger_enable_rule(int rule_id)
{
+ CHECK_CONTEXT_TRIGGER_SUPPORTED(CONTEXT_TRIGGER_FEATURE);
INIT_SCHED;
if (rule_id <= 0)
return CONTEXT_TRIGGER_ERROR_INVALID_PARAMETER;
EXPORT_API int context_trigger_disable_rule(int rule_id)
{
+ CHECK_CONTEXT_TRIGGER_SUPPORTED(CONTEXT_TRIGGER_FEATURE);
INIT_SCHED;
if (rule_id <= 0)
return CONTEXT_TRIGGER_ERROR_INVALID_PARAMETER;
EXPORT_API int context_trigger_get_own_rule_ids(int** enabled_rule_ids, int* enabled_rule_count, int** disabled_rule_ids, int* disabled_rule_count)
{
+ CHECK_CONTEXT_TRIGGER_SUPPORTED(CONTEXT_TRIGGER_FEATURE);
INIT_SCHED;
ASSERT_NOT_NULL(enabled_rule_ids && enabled_rule_count && disabled_rule_ids && disabled_rule_count);
EXPORT_API int context_trigger_get_rule_by_id(int rule_id, context_trigger_rule_h* rule)
{
+ CHECK_CONTEXT_TRIGGER_SUPPORTED(CONTEXT_TRIGGER_FEATURE);
INIT_SCHED;
ASSERT_NOT_NULL(rule);
if (rule_id <= 0)
EXPORT_API int context_trigger_rule_create(context_trigger_logical_type_e logical_type, context_trigger_rule_h* rule)
{
+ CHECK_CONTEXT_TRIGGER_SUPPORTED(CONTEXT_TRIGGER_FEATURE);
ASSERT_NOT_NULL(rule);
IF_FAIL_RETURN(logical_type == CONTEXT_TRIGGER_LOGICAL_CONJUNCTION || logical_type == CONTEXT_TRIGGER_LOGICAL_DISJUNCTION, E_PARAM);
EXPORT_API int context_trigger_rule_destroy(context_trigger_rule_h rule)
{
+ CHECK_CONTEXT_TRIGGER_SUPPORTED(CONTEXT_TRIGGER_FEATURE);
INIT_SCHED;
ASSERT_NOT_NULL(rule);
static int __set_event(context_trigger_rule_h rule, context_trigger_rule_entry_h event)
{
+ CHECK_CONTEXT_TRIGGER_SUPPORTED(CONTEXT_TRIGGER_FEATURE);
IF_FAIL_RETURN(event->jobContext, E_PARAM);
IF_FAIL_RETURN_TAG(!rule->hasEvent, E_INV_RULE, _E, "The rule already has the event");
static int __add_condition(context_trigger_rule_h rule, context_trigger_rule_entry_h condition)
{
+ CHECK_CONTEXT_TRIGGER_SUPPORTED(CONTEXT_TRIGGER_FEATURE);
IF_FAIL_RETURN(condition->jobContext, E_PARAM);
bool exist = (rule->conditions.find(condition->uri) != rule->conditions.end());
EXPORT_API int context_trigger_rule_add_entry(context_trigger_rule_h rule, context_trigger_rule_entry_h entry)
{
+ CHECK_CONTEXT_TRIGGER_SUPPORTED(CONTEXT_TRIGGER_FEATURE);
ASSERT_NOT_NULL(rule && entry);
IF_FAIL_RETURN_TAG(!rule->readOnly, E_PARAM,
_E, "A rule acquired by context_trigger_get_rule_by_id() is not allowed to be modified.");
EXPORT_API int context_trigger_rule_set_action_app_control(context_trigger_rule_h rule, app_control_h app_control)
{
+ CHECK_CONTEXT_TRIGGER_SUPPORTED(CONTEXT_TRIGGER_FEATURE);
INIT_SCHED;
ASSERT_NOT_NULL(rule && app_control);
EXPORT_API int context_trigger_rule_set_action_notification(context_trigger_rule_h rule,
const char* title, const char* content, const char* icon_path, app_control_h app_control)
{
+ CHECK_CONTEXT_TRIGGER_SUPPORTED(CONTEXT_TRIGGER_FEATURE);
INIT_SCHED;
ASSERT_NOT_NULL(rule && title && content);
EXPORT_API int context_trigger_rule_set_action_dbus_call(context_trigger_rule_h rule,
const char *bus_name, const char *object_path, const char *interface_name, const char *method_name, GVariant *param)
{
+ CHECK_CONTEXT_TRIGGER_SUPPORTED(CONTEXT_TRIGGER_FEATURE);
ASSERT_NOT_NULL(rule && bus_name && object_path && interface_name && method_name);
IF_FAIL_RETURN_TAG(!rule->hasAction, E_INV_RULE, _E, "The rule has an action");
EXPORT_API int context_trigger_rule_set_description(context_trigger_rule_h rule, const char* description)
{
+ CHECK_CONTEXT_TRIGGER_SUPPORTED(CONTEXT_TRIGGER_FEATURE);
ASSERT_NOT_NULL(rule && description);
IF_FAIL_RETURN(strlen(description) > 0, E_PARAM);
EXPORT_API int context_trigger_rule_get_description(context_trigger_rule_h rule, char** description)
{
+ CHECK_CONTEXT_TRIGGER_SUPPORTED(CONTEXT_TRIGGER_FEATURE);
ASSERT_NOT_NULL(rule && description);
char* val = NULL;
EXPORT_API int context_trigger_rule_event_create(context_trigger_event_e event_item, context_trigger_logical_type_e logical_type, context_trigger_rule_entry_h* entry)
{
+ CHECK_CONTEXT_TRIGGER_SUPPORTED(CONTEXT_TRIGGER_FEATURE);
INIT_SCHED;
ASSERT_NOT_NULL(entry);
IF_FAIL_RETURN(logical_type == CONTEXT_TRIGGER_LOGICAL_CONJUNCTION || logical_type == CONTEXT_TRIGGER_LOGICAL_DISJUNCTION, E_PARAM);
static bool __is_valid_pkg_id(const char* pkgId)
{
+ CHECK_CONTEXT_TRIGGER_SUPPORTED(CONTEXT_TRIGGER_FEATURE);
IF_FAIL_RETURN(pkgId, false);
pkgmgrinfo_pkginfo_h pkgInfo;
EXPORT_API int context_trigger_rule_custom_event_create(const char* event_item, const char* provider, context_trigger_logical_type_e logical_type, context_trigger_rule_entry_h* entry)
{
+ CHECK_CONTEXT_TRIGGER_SUPPORTED(CONTEXT_TRIGGER_FEATURE);
INIT_SCHED;
ASSERT_NOT_NULL(event_item && provider && entry);
IF_FAIL_RETURN_TAG(__is_valid_pkg_id(provider), CONTEXT_TRIGGER_ERROR_INVALID_DATA, _E, "No such package");
EXPORT_API int context_trigger_rule_event_is_supported(context_trigger_event_e event_item, bool* supported)
{
+ CHECK_CONTEXT_TRIGGER_SUPPORTED(CONTEXT_TRIGGER_FEATURE);
INIT_SCHED;
ASSERT_NOT_NULL(supported);
EXPORT_API int context_trigger_rule_condition_create(context_trigger_condition_e condition_item, context_trigger_logical_type_e logical_type, context_trigger_rule_entry_h* entry)
{
+ CHECK_CONTEXT_TRIGGER_SUPPORTED(CONTEXT_TRIGGER_FEATURE);
INIT_SCHED;
ASSERT_NOT_NULL(entry);
IF_FAIL_RETURN(logical_type == CONTEXT_TRIGGER_LOGICAL_CONJUNCTION || logical_type == CONTEXT_TRIGGER_LOGICAL_DISJUNCTION, E_PARAM);
EXPORT_API int context_trigger_rule_custom_condition_create(const char* condition_item, const char* provider, context_trigger_logical_type_e logical_type, context_trigger_rule_entry_h* entry)
{
+ CHECK_CONTEXT_TRIGGER_SUPPORTED(CONTEXT_TRIGGER_FEATURE);
INIT_SCHED;
ASSERT_NOT_NULL(condition_item && provider && entry);
IF_FAIL_RETURN(logical_type == CONTEXT_TRIGGER_LOGICAL_CONJUNCTION || logical_type == CONTEXT_TRIGGER_LOGICAL_DISJUNCTION, E_PARAM);
EXPORT_API int context_trigger_rule_condition_is_supported(context_trigger_condition_e condition_item, bool* supported)
{
+ CHECK_CONTEXT_TRIGGER_SUPPORTED(CONTEXT_TRIGGER_FEATURE);
INIT_SCHED;
ASSERT_NOT_NULL(supported);
EXPORT_API int context_trigger_rule_entry_destroy(context_trigger_rule_entry_h entry)
{
+ CHECK_CONTEXT_TRIGGER_SUPPORTED(CONTEXT_TRIGGER_FEATURE);
INIT_SCHED;
ASSERT_NOT_NULL(entry);
EXPORT_API int context_trigger_rule_entry_add_option_int(context_trigger_rule_entry_h entry, const char* option_key, int value)
{
+ CHECK_CONTEXT_TRIGGER_SUPPORTED(CONTEXT_TRIGGER_FEATURE);
ASSERT_NOT_NULL(entry && option_key);
ContextItem* contextItem = __get_context_item(entry);
EXPORT_API int context_trigger_rule_entry_add_option_string(context_trigger_rule_entry_h entry, const char* option_key, const char* value)
{
_DEPRECATED_FUNC;
+ CHECK_CONTEXT_TRIGGER_SUPPORTED(CONTEXT_TRIGGER_FEATURE);
ASSERT_NOT_NULL(entry && option_key && value);
ContextItem* contextItem = __get_context_item(entry);
EXPORT_API int context_trigger_rule_entry_add_option(context_trigger_rule_entry_h entry, const char* option_key, const char* event_data_key)
{
_DEPRECATED_FUNC;
+ CHECK_CONTEXT_TRIGGER_SUPPORTED(CONTEXT_TRIGGER_FEATURE);
ASSERT_NOT_NULL(entry && option_key && event_data_key);
IF_FAIL_RETURN(entry->category == CATEGORY_CONDITION, E_INV_RULE);
EXPORT_API int context_trigger_rule_entry_add_key(context_trigger_rule_entry_h entry, context_trigger_logical_type_e logical_type, const char* key)
{
+ CHECK_CONTEXT_TRIGGER_SUPPORTED(CONTEXT_TRIGGER_FEATURE);
ASSERT_NOT_NULL(entry && key);
IF_FAIL_RETURN(logical_type == CONTEXT_TRIGGER_LOGICAL_CONJUNCTION || logical_type == CONTEXT_TRIGGER_LOGICAL_DISJUNCTION, E_PARAM);
EXPORT_API int context_trigger_rule_entry_add_comparison(context_trigger_rule_entry_h entry, const char* key, const char* op, const char* event_data_key)
{
_DEPRECATED_FUNC;
+ CHECK_CONTEXT_TRIGGER_SUPPORTED(CONTEXT_TRIGGER_FEATURE);
ASSERT_NOT_NULL(entry && key && op && event_data_key);
IF_FAIL_RETURN(entry->category == CATEGORY_CONDITION, E_INV_RULE);
EXPORT_API int context_trigger_rule_entry_add_comparison_int(context_trigger_rule_entry_h entry, const char* key, const char* op, int value)
{
+ CHECK_CONTEXT_TRIGGER_SUPPORTED(CONTEXT_TRIGGER_FEATURE);
ASSERT_NOT_NULL(entry && key && op);
ContextItem* contextItem = __get_context_item(entry);
EXPORT_API int context_trigger_rule_entry_add_comparison_string(context_trigger_rule_entry_h entry, const char* key, const char* op, const char* value)
{
+ CHECK_CONTEXT_TRIGGER_SUPPORTED(CONTEXT_TRIGGER_FEATURE);
ASSERT_NOT_NULL(entry && key && op && value);
ContextItem* contextItem = __get_context_item(entry);
EXPORT_API int context_trigger_custom_register(const char* name, const char* attr_template)
{
+ CHECK_CONTEXT_TRIGGER_SUPPORTED(CONTEXT_TRIGGER_FEATURE);
INIT_SCHED;
ASSERT_NOT_NULL(name && attr_template);
EXPORT_API int context_trigger_custom_unregister(const char* name)
{
+ CHECK_CONTEXT_TRIGGER_SUPPORTED(CONTEXT_TRIGGER_FEATURE);
INIT_SCHED;
ASSERT_NOT_NULL(name);
EXPORT_API int context_trigger_custom_publish(const char* name, const char* fact)
{
+ CHECK_CONTEXT_TRIGGER_SUPPORTED(CONTEXT_TRIGGER_FEATURE);
INIT_SCHED;
ASSERT_NOT_NULL(name && fact);