Support ambient block tick state 98/234398/2
authorhyunho <hhstark.kang@samsung.com>
Tue, 26 May 2020 05:36:58 +0000 (14:36 +0900)
committerhyunho <hhstark.kang@samsung.com>
Tue, 26 May 2020 05:37:56 +0000 (14:37 +0900)
Change-Id: Ieb0c8b9b108d75aeb487a9da2acc7485dce2ec4c
Signed-off-by: hyunho <hhstark.kang@samsung.com>
appcore_ui_app_ambient/include/ui_app_ambient.h
appcore_ui_app_ambient/src/ui_app_ambient.c

index 4193eb632b6f78b5c1e1b47427bdd8ffea344770..70f44a971431a087451a5c992e08b3dab21a933c 100644 (file)
@@ -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.
index efd8a7aefb0dad75d5d268b95273351a1e2f88da..b256c26d0491fa49eaeca9533008e917c685b74f 100644 (file)
@@ -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);