Fix handling visibility event 77/203277/1
authorHwankyu Jhun <h.jhun@samsung.com>
Thu, 11 Apr 2019 08:06:25 +0000 (17:06 +0900)
committerHwankyu Jhun <h.jhun@samsung.com>
Thu, 11 Apr 2019 08:06:25 +0000 (17:06 +0900)
Currently, the watch core doesn't check viewer visibility state before
removing pause timer. After this patch is applied, the watch core checks
whether the viewer is resumed or not.

Change-Id: Id1cd989ef0ada75751ece09c9a40be1bb60fa76b
Signed-off-by: Hwankyu Jhun <h.jhun@samsung.com>
src/base/watch_base.c

index 54d5148..ced59e1 100755 (executable)
@@ -738,12 +738,13 @@ static void __on_window_visibility(int type, void *event, void *data)
                __context.watch_visibility = WVS_PAUSE;
                __add_pause_timer();
        } else {
-               __remove_pause_timer();
                __context.watch_visibility = WVS_RESUME;
-               if (__context.viewer_visibility == AUL_SCREEN_STATUS_RESUME)
+               if (__context.viewer_visibility == AUL_SCREEN_STATUS_RESUME) {
+                       __remove_pause_timer();
                        __on_ui_base_resume(NULL);
-               else
+               } else {
                        _D("Viewer is paused, do not resume watch");
+               }
        }
 }