From: hyunho Date: Tue, 26 May 2020 05:36:58 +0000 (+0900) Subject: Support ambient block tick state X-Git-Tag: submit/tizen/20200527.023831~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F98%2F234398%2F2;p=platform%2Fcore%2Fapi%2Fapplication.git Support ambient block tick state Change-Id: Ieb0c8b9b108d75aeb487a9da2acc7485dce2ec4c Signed-off-by: hyunho --- diff --git a/appcore_ui_app_ambient/include/ui_app_ambient.h b/appcore_ui_app_ambient/include/ui_app_ambient.h index 4193eb6..70f44a9 100644 --- a/appcore_ui_app_ambient/include/ui_app_ambient.h +++ b/appcore_ui_app_ambient/include/ui_app_ambient.h @@ -46,6 +46,16 @@ typedef enum { UI_APP_AMBIENT_EVENT_READY } ui_app_ambient_event_e; +/** + * @brief Enumeration for ambient state. + * @remark This function only for internal applications + */ +typedef enum { + UI_APP_AMBIENT_STATE_LEAVE, + UI_APP_AMBIENT_STATE_ENTER, + UI_APP_AMBIENT_STATE_BLOCK_TICK +} ui_app_ambient_state_e; + /** * @brief Called with the period set with ui_app_ambient_set_update_period() if the device is in the ambient mode. * @remark This function only for internal applications @@ -58,12 +68,12 @@ typedef void (*ui_app_ambient_update_frame_cb) (void *user_data); /** * @brief Called when the device enters or exits the ambient mode. * @remark This function only for internal applications - * @param[in] ambient_mode Whether ambient mode is true or not + * @param[in] state The ambient mode * @param[in] data The extra bundle data from ambient viewer * @param[in] user_data The user data to be passed to the callback functions * @see ui_app_ambient_set_lifecycle() */ -typedef void (*ui_app_ambient_changed_cb) (bool ambient_mode, bundle *data, void *user_data); +typedef void (*ui_app_ambient_changed_cb) (ui_app_ambient_state_e state, bundle *data, void *user_data); /** * @brief The structure type containing the set of callback functions for application events handle. diff --git a/appcore_ui_app_ambient/src/ui_app_ambient.c b/appcore_ui_app_ambient/src/ui_app_ambient.c index efd8a7a..b256c26 100644 --- a/appcore_ui_app_ambient/src/ui_app_ambient.c +++ b/appcore_ui_app_ambient/src/ui_app_ambient.c @@ -212,7 +212,7 @@ int __on_change_signal(const char *endpoint, aul_app_com_result_e e, b = bundle_decode((bundle_raw *)extra, strlen(extra)); if (ambient_lifecycle.ambient_changed) - ambient_lifecycle.ambient_changed((bool)atoi(mode), b, user_data); + ambient_lifecycle.ambient_changed((ui_app_ambient_state_e)atoi(mode), b, user_data); if (b) bundle_free(b);