Fix wrong resume check for ambient enter state 50/235350/1
authorhyunho <hhstark.kang@samsung.com>
Thu, 4 Jun 2020 05:13:07 +0000 (14:13 +0900)
committerhyunho <hhstark.kang@samsung.com>
Thu, 4 Jun 2020 05:13:07 +0000 (14:13 +0900)
Change-Id: Ic5dd43db863c5f07321397d43e48532a2f0a5a5f
Signed-off-by: hyunho <hhstark.kang@samsung.com>
src/base/watch_base.c

index 4068d3b..65ffc3b 100755 (executable)
@@ -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;