WATCH_BASE_AMBIENT_EVENT_NOTIFIED
} watch_base_ambient_event_e;
+typedef enum {
+ WATCH_BASE_AMBIENT_STATE_LEAVE,
+ WATCH_BASE_AMBIENT_STATE_ENTER,
+ WATCH_BASE_AMBIENT_STATE_BLOCK_TICK
+} watch_base_ambient_state_e;
+
int watch_base_set_ambient_tick_type(watch_base_ambient_tick_type_e type);
int watch_base_get_ambient_tick_type(watch_base_ambient_tick_type_e *type);
int watch_base_time_get_current_time(watch_base_time_h *watch_base_time);
int width;
int height;
enum watch_visible_state watch_visibility;
+ bool clock_tick_block;
bool ambient_mode;
bool ambient_mode_skip_resume;
bool bg_launch;
};
/* Enter the ambient mode */
- if (ambient) {
+ if (ambient == WATCH_BASE_AMBIENT_STATE_ENTER) {
if (appcore_ui_base_is_resumed()) {
appcore_ui_base_on_pause();
if (__context.callback.pause)
watch_base_ambient_notify_event(
WATCH_BASE_AMBIENT_EVENT_NOTIFIED, NULL);
_watch_base_signal_send_alpm_update_done();
- } else { /* Exit the ambient mode */
+ } else if (ambient == WATCH_BASE_AMBIENT_STATE_LEAVE) { /* Exit the ambient mode */
_watch_base_time_get_timeinfo(&timeinfo);
__on_ambient_tick(&timeinfo, data);
alarmmgr_remove_alarm(alarm_id);
alarm_id = 0;
}
+ } else if (ambient == WATCH_BASE_AMBIENT_STATE_BLOCK_TICK) {
+ _W("Disable the alarm");
+ /* Disable alarm */
+ if (alarm_id) {
+ alarmmgr_remove_alarm(alarm_id);
+ alarm_id = 0;
+ }
+ __context.clock_tick_block = true;
}
+
if (timeinfo.timezone)
free(timeinfo.timezone);
.timezone = NULL
};
+ if (__context.clock_tick_block) {
+ _W("clock tick blocked skip tick");
+ return;
+ }
+
_D("ambient_mode check: %d", __context.ambient_mode);
_watch_base_time_get_timeinfo(&timeinfo);
if (__context.ambient_mode) {