diff options
author | Jiwoong Im <jiwoong.im@samsung.com> | 2016-04-27 21:32:07 +0900 |
---|---|---|
committer | Jiwoong Im <jiwoong.im@samsung.com> | 2016-04-28 15:31:37 +0900 |
commit | 85024fa7e299887a0ca2fb4e3048c74d537aee05 (patch) | |
tree | 090074700a3152ccbec1f994b18bdf91f37303a7 /include | |
parent | 5fb67651de151cb94abc8c8c677329101c042717 (diff) | |
download | alarm-manager-85024fa7e299887a0ca2fb4e3048c74d537aee05.tar.gz alarm-manager-85024fa7e299887a0ca2fb4e3048c74d537aee05.tar.bz2 alarm-manager-85024fa7e299887a0ca2fb4e3048c74d537aee05.zip |
merge async api from tizen 2.4submit/tizen/20160428.065355accepted/tizen/wearable/20160429.011334accepted/tizen/tv/20160429.011345accepted/tizen/mobile/20160429.011326accepted/tizen/ivi/20160429.011352accepted/tizen/common/20160428.144908
- alarmmgr_set_systime_async
- alarmmgr_set_systime_with_propagation_delay_async
Change-Id: I37ecfcbb4207478df698497a0cd80090db664973
Signed-off-by: Jiwoong Im <jiwoong.im@samsung.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/alarm-internal.h | 13 | ||||
-rw-r--r-- | include/alarm.h | 30 |
2 files changed, 43 insertions, 0 deletions
diff --git a/include/alarm-internal.h b/include/alarm-internal.h index 69c9c4e..6214b6c 100644 --- a/include/alarm-internal.h +++ b/include/alarm-internal.h @@ -91,6 +91,17 @@ typedef struct { alarm_repeat_mode_t repeat; /**< repeat mode */ } alarm_mode_t; +typedef struct { + alarm_set_time_cb_t callback; + void *user_data; + GDBusProxy *proxy; +} alarm_set_time_data_t; + +enum async_param_type { + SET_SYSTIME = 0, + SET_SYSTIME_WITH_PROPAGATION_DELAY, +}; + /** * This enumeration has alarm type @@ -137,9 +148,11 @@ bool _load_alarms_from_registry(); bundle *_send_alarm_get_appsvc_info(alarm_context_t context, alarm_id_t alarm_id, int *error_code); bool _send_alarm_set_rtc_time(alarm_context_t context, alarm_date_t *time, int *error_code); bool _send_alarm_set_time_with_propagation_delay(alarm_context_t context, unsigned int new_sec, unsigned int new_nsec, unsigned int req_sec, unsigned int req_nsec, int *error_code); +bool _send_alarm_set_time_with_propagation_delay_async(alarm_context_t context, unsigned int new_sec, unsigned int new_nsec, unsigned int req_sec, unsigned int req_nsec, alarm_set_time_cb_t result_cb, void *user_data); 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_time_async(alarm_context_t context, int new_time, alarm_set_time_cb_t result_cb, void *user_data); 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); diff --git a/include/alarm.h b/include/alarm.h index 0edd294..1bbc389 100644 --- a/include/alarm.h +++ b/include/alarm.h @@ -165,6 +165,8 @@ typedef int alarm_id_t; * The prototype of alarm handler. * param [in] alarm_id the id of expired alarm */ +typedef int (*alarm_set_time_cb_t) (int result, void *user_param); + typedef int (*alarm_cb_t) (alarm_id_t alarm_id, void *user_param); typedef int (*alarm_enum_fn_t) (alarm_id_t alarm_id, void *user_param); @@ -1380,6 +1382,19 @@ int alarmmgr_set_rtc_time(alarm_date_t *time); int alarmmgr_set_systime(int new_time); /** + * This function asynchronously changes the system time which tranferred by other module + * @param [in] new_time epoch time to be set + * @param [in] result_cb The asynchronous callback function to get the result + * @param [in] user_param User parameter to be passed to the callback function + * + * @return @c ALARMMGR_RESULT_SUCCESS on success, + * otherwise a negative error value + * @retval #ALARMMGR_RESULT_SUCCESS Successful + * @retval #ERR_ALARM_SYSTEM_FAIL System failure + */ +int alarmmgr_set_systime_async(int new_time, alarm_set_time_cb_t result_cb, void *user_param); + +/** * This function changes the system time and compensates the time using propagation delay. * @param [in] new_time system time to be set (seconds, nanoseconds) * @param [in] req_time time to request to change the system time (seconds, nanoseconds) @@ -1393,6 +1408,21 @@ int alarmmgr_set_systime(int new_time); int alarmmgr_set_systime_with_propagation_delay(struct timespec new_time, struct timespec req_time); /** + * This function asynchronously changes the system time and compensates the time using propagation delay. + * @param [in] new_time system time to be set (seconds, nanoseconds) + * @param [in] req_time time to request to change the system time (seconds, nanoseconds) + * @param [in] result_cb The asynchronous callback function to get the result + * @param [in] user_param User parameter to be passed to the callback function + * + * @return @c ALARMMGR_RESULT_SUCCESS on success, + * otherwise a negative error value + * @retval #ALARMMGR_RESULT_SUCCESS Successful + * @retval #ERR_ALARM_SYSTEM_FAIL System failure + * @retval #ERR_ALARM_INVALID_PARAM invalid parameter + */ +int alarmmgr_set_systime_with_propagation_delay_async(struct timespec new_time, struct timespec req_time, alarm_set_time_cb_t result_cb, void *user_param); + +/** * This function changes the timezone which tranferred by other module * @param [in] tzpath_str the path to timezone definition file * |