Call tick when pre resume state 28/151228/1
authorHyunho Kang <hhstark.kang@samsung.com>
Thu, 10 Aug 2017 11:26:41 +0000 (20:26 +0900)
committerHyunho Kang <hhstark.kang@samsung.com>
Wed, 20 Sep 2017 08:11:48 +0000 (17:11 +0900)
Change-Id: Iac80245a5f3a5e9aed12ebc96158304f60d736b0
Signed-off-by: Hyunho Kang <hhstark.kang@samsung.com>
src/watch_app_main.c

index 992a81c..fd1f0f4 100755 (executable)
@@ -716,6 +716,7 @@ static int __viewer_state_handler(const char *widget_id, aul_app_com_result_e e,
 {
        int *state = NULL;
        size_t state_sz = 0;
+       struct _watch_time_s timeinfo;
 
        bundle_get_byte(envelope, "__AUL_SC_VIEWER_STATUS__", (void **)&state,
                        &state_sz);
@@ -723,14 +724,23 @@ static int __viewer_state_handler(const char *widget_id, aul_app_com_result_e e,
                _E("Failed to get viewer status");
                return -1;
        }
-       __context.viewer_visibility = *state;
-       _D("set viewer state to %d", *state);
+
+       _D("receive viewer state %d", *state);
+       if (*state != AUL_SCREEN_STATUS_PRE_RESUME) {
+               __context.viewer_visibility = *state;
+               _D("set viewer state to %d", *state);
+       }
 
        if (*state == AUL_SCREEN_STATUS_RESUME &&
-                       __context.watch_visibility == WVS_RESUME)
+                       __context.watch_visibility == WVS_RESUME) {
                __on_resume(NULL);
-       else if (*state == AUL_SCREEN_STATUS_PAUSE)
+       } else if (*state == AUL_SCREEN_STATUS_PAUSE) {
                __on_pause(NULL);
+       } else if (*state == AUL_SCREEN_STATUS_PRE_RESUME) {
+               __get_timeinfo(&timeinfo);
+               _D("call pre resume tick");
+               __on_time_tick(&timeinfo, NULL);
+       }
 
        return 0;
 }