From 3318483654029e3f0ff3ffa0f902d31bb34bc3cb Mon Sep 17 00:00:00 2001 From: hyunho Date: Thu, 4 Jun 2020 14:13:07 +0900 Subject: [PATCH] Fix wrong resume check for ambient enter state Change-Id: Ic5dd43db863c5f07321397d43e48532a2f0a5a5f Signed-off-by: hyunho --- src/base/watch_base.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/base/watch_base.c b/src/base/watch_base.c index 4068d3b..65ffc3b 100755 --- a/src/base/watch_base.c +++ b/src/base/watch_base.c @@ -150,6 +150,7 @@ static void __on_ambient_tick(void *watchtime, void *data); 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) { @@ -398,10 +399,8 @@ static int __handling_ambient_mode(int ambient, void *data) /* 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; @@ -428,7 +427,6 @@ static int __handling_ambient_mode(int ambient, void *data) _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); } @@ -838,6 +836,7 @@ static void __on_window_visibility(int type, void *event, void *data) if (ev->fully_obscured) { __context.watch_visibility = WVS_PAUSE; __on_ui_base_pause(NULL); + } else { __context.watch_visibility = WVS_RESUME; __context.bg_launch = false; -- 2.7.4