{
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);
_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;
}