diff options
-rw-r--r-- | alarm/alarm.c | 17 | ||||
-rw-r--r-- | include/app_alarm.h | 45 |
2 files changed, 62 insertions, 0 deletions
diff --git a/alarm/alarm.c b/alarm/alarm.c index 2d7863f..f0c4d98 100644 --- a/alarm/alarm.c +++ b/alarm/alarm.c @@ -510,3 +510,20 @@ int alarm_get_app_control(int alarm_id, app_control_h *app_control) return ALARM_ERROR_NONE; } +int alarm_set_global(int alarm_id, bool global) +{ + int ret; + + ret = alarmmgr_set_global(alarm_id, glbal); + + return convert_error_code_to_alarm(__FUNCTION__, ret); +} + +int alarm_get_global(int alarm_id, bool *global) +{ + int ret; + + ret = alarmmgr_get_global(alarm_id, global); + + return convert_error_code_to_alarm(__FUNCTION__, ret); +} diff --git a/include/app_alarm.h b/include/app_alarm.h index c29862a..8aac216 100644 --- a/include/app_alarm.h +++ b/include/app_alarm.h @@ -407,6 +407,51 @@ int alarm_get_current_time(struct tm *date); */ int alarm_get_app_control(int alarm_id, app_control_h *app_control); + +/** + * @brief Sets global flag in the alarm. + * @details Sets @a global flag to set/unset alarm globally. + * @since_tizen 3.0 + * @privlevel public + * @privilege %http://tizen.org/privilege/alarm.set + * @remarks The @a alarm_id must be id of alarm which will launch global application. + * The function returns an error (error code #ALARM_ERROR_NOT_PERMITTED) if it is not. + * Note that the application which is launched by global alarm runs in the user session that is logined currently. + * It doesn't run in the session for the user who registers the global alarm. + * So, If the application uses application's private data for each user to handling the app_control for the alarm, it might not show proper data to the user. + * Therefore, We recommend to contain all the data for the alarm to the app_control handle for the global alarm. + * Then, the launched application would be able to use the data to show proper alarm UX to the user. + * @param[in] alarm_id The alarm ID uniquely identifies an alarm + * @param[in] global The global flag to set/unset alarm globally + * @return @c 0 on success, + * otherwise a negative error value + * @retval #ALARM_ERROR_NONE Successful + * @retval #ALARM_ERROR_INVALID_PARAMETER Invalid parameter + * @retval #ALARM_ERROR_NOT_PERMITTED @a alarm_id is not permitted. + * @retval #ALARM_ERROR_PERMISSION_DENIED Permission denied + * @see alarm_schedule_at_date() + * @see alarm_schedule_after_delay() + * @see alarm_schedule_with_recurrence_week_flag() + */ +int alarm_set_global(int alarm_id, bool global); + + +/** + * @brief Gets whether the alarm will launch global application or not. + * @since_tizen 3.0 + * @privlevel public + * @privilege %http://tizen.org/privilege/alarm.get + * @param[in] alarm_id The alarm ID uniquely identifies an alarm + * @param[out] global Whether the alarm will launch global application or not. + * @return @c 0 on success, + * otherwise a negative error value + * @retval #ALARM_ERROR_NONE Successful + * @retval #ALARM_ERROR_INVALID_PARAMETER Invalid parameter + * @retval #ALARM_ERROR_PERMISSION_DENIED Permission denied + * @see alarm_set_global(); + */ +int alarm_get_global(int alarm_id, bool *global); + /** * @} */ |