} 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
/**
* @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.
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);