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 4193eb6..70f44a9 100644 (file)
@@ -47,6 +47,16 @@ typedef enum {
 } 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
  * @param[in] user_data The user data to be passed to the callback functions
@@ -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 efd8a7a..b256c26 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);