diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/alarm-internal.h | 3 | ||||
-rw-r--r-- | include/alarm.h | 29 |
2 files changed, 32 insertions, 0 deletions
diff --git a/include/alarm-internal.h b/include/alarm-internal.h index 4298c27..87b48b0 100644 --- a/include/alarm-internal.h +++ b/include/alarm-internal.h @@ -140,6 +140,8 @@ bool _send_alarm_set_time_with_propagation_delay(alarm_context_t context, unsign bool _send_alarm_set_timezone(alarm_context_t context, char *tzpath_str, int *error_code); bool _send_alarm_create_periodic(alarm_context_t context, int interval, int is_ref, int method, alarm_id_t *alarm_id, int *error_code); bool _send_alarm_set_time(alarm_context_t context, int new_time, int *error_code); +bool _send_alarm_set_global(alarm_context_t context, int alarm_id, bool global, int *error_code); +bool _send_alarm_get_global(alarm_context_t context, int alarm_id, bool *global, int *error_code); /* alarm manager*/ typedef struct { @@ -170,6 +172,7 @@ typedef struct { periodic_method_e method; long requested_interval; int is_ref; + bool global; } __alarm_info_t; typedef struct { diff --git a/include/alarm.h b/include/alarm.h index fe34d18..0edd294 100644 --- a/include/alarm.h +++ b/include/alarm.h @@ -1404,6 +1404,35 @@ int alarmmgr_set_systime_with_propagation_delay(struct timespec new_time, struct */ int alarmmgr_set_timezone(char *tzpath_str); +/** + * This function sets global + * @remarks The @a alarm_id must be id of alarm which will launch global application. + * The function returns an error (error code #ERR_ALARM_INVALID_ID) if it is not. + * @param [in] alarm_id the id of the alarm + * @param [in] global value to set global or not + * + * @return @c ALARMMGR_RESULT_SUCCESS on success, + * otherwise a negative error value + * @retval #ALARMMGR_RESULT_SUCCESS Successful + * @retval #ERR_ALARM_INVALID_PARAM Invalid parameter + * @retval #ERR_ALARM_INVALID_ID Invaild id of the alarm + * @retval #ERR_ALARM_SYSTEM_FAIL System failure + */ +int alarmmgr_set_global(alarm_id_t alarm_id, bool global); + +/** + * This function gets global + * @param [in] alarm_id the id of the alarm + * @param [out] global Whether the alarm is global or not + * + * @return @c ALARMMGR_RESULT_SUCCESS on success, + * otherwise a negative error value + * @retval #ALARMMGR_RESULT_SUCCESS Successful + * @retval #ERR_ALARM_INVALID_PARAM Invalid parameter + * @retval #ERR_ALARM_INVALID_ID Invaild id of the alarm + * @retval #ERR_ALARM_SYSTEM_FAIL System failure + */ +int alarmmgr_get_global(const alarm_id_t alarm_id, bool *global); int alarmmgr_add_alarm_withcb(int alarm_type, time_t trigger_at_time, time_t interval, alarm_cb_t handler, void *user_param, alarm_id_t *alarm_id); |