typedef enum {
WATCH_BASE_AMBIENT_EVENT_PREPARE,
WATCH_BASE_AMBIENT_EVENT_READY,
- WATCH_BASE_AMBIENT_EVENT_CHANGED
+ WATCH_BASE_AMBIENT_EVENT_NOTIFIED
} watch_base_ambient_event_e;
int watch_base_set_ambient_tick_type(watch_base_ambient_tick_type_e type);
/* LCOV_EXCL_STOP */
/* LCOV_EXCL_START */
-static int __signal_alpm_handler(int ambient, void *data)
+static int __handling_ambient_mode(int ambient, void *data)
{
+ _I("_handling ambient event: (ambient: %d)", ambient);
struct _watch_base_time_s timeinfo = {
.timezone = NULL
};
- _D("_signal_alpm_handler: ambient: %d", ambient);
- if (__context.ambient_mode == ambient) {
- _E("invalid state");
- return 0;
- }
-
/* Enter the ambient mode */
if (ambient) {
if (appcore_ui_base_is_resumed()) {
__set_ambient_tick_cb(data);
/* Send a update done signal */
+ watch_base_ambient_notify_event(
+ WATCH_BASE_AMBIENT_EVENT_NOTIFIED, NULL);
_watch_base_signal_send_alpm_update_done();
} else { /* Exit the ambient mode */
return 0;
}
+
+static int __signal_alpm_handler(int ambient, void *data)
+{
+ _D("_signal_alpm_handler: ambient: %d", ambient);
+ if (__context.ambient_mode == ambient) {
+ _E("invalid state");
+ return 0;
+ }
+ return __handling_ambient_mode(ambient, data);
+}
/* LCOV_EXCL_STOP */
static Eina_Bool __time_tick_cb(void *data)
{
char *extra;
char *mode;
- watch_base_ambient_changed_cb ambient_changed_cb;
_W("__on_change_signal");
-
bundle_get_str(envelope, "__AMBIENT_MODE__", &mode);
bundle_get_str(envelope, "__AMBIENT_EXTRA__", &extra);
__context.extra = bundle_decode((bundle_raw *)extra, strlen(extra));
-
- ambient_changed_cb = __context.callback.ambient_changed;
-
- if (ambient_changed_cb != NULL)
- ambient_changed_cb((bool)atoi(mode), __context.data);
+ __handling_ambient_mode(atoi(mode), NULL);
return 0;
}