static void __on_ambient_changed(int ambient, void *data);
static void __on_time_tick(void *watchtime, void *data);
static int __on_ui_base_resume(void *data);
+static int __on_ui_base_pause(void *data);
static const char *__error_to_string(app_error_e error)
{
/* Enter the ambient mode */
if (ambient == WATCH_BASE_AMBIENT_STATE_ENTER) {
- if (appcore_ui_base_is_resumed()) {
- appcore_ui_base_on_pause();
- if (__context.callback.pause)
- __context.callback.pause(__context.data);
+ if (__state == WS_RUNNING) {
+ __on_ui_base_pause(NULL);
__context.ambient_mode_skip_resume = false;
} else {
__context.ambient_mode_skip_resume = true;
_D("Resume check: %d", __context.ambient_mode_skip_resume);
if (!__context.ambient_mode_skip_resume) {
_D("Call the resume after ambient mode changed");
- appcore_ui_base_on_resume();
__on_ui_base_resume(NULL);
}
if (ev->fully_obscured) {
__context.watch_visibility = WVS_PAUSE;
__on_ui_base_pause(NULL);
+
} else {
__context.watch_visibility = WVS_RESUME;
__context.bg_launch = false;