};
double sec;
- __get_timeinfo(&timeinfo);
+ _D("state: %d", __state);
+ if (__context.callback.time_tick && __state != WS_PAUSED) {
+ __get_timeinfo(&timeinfo);
- /* Set a next timer */
- sec = __get_next_tick_sec();
- watch_tick = ecore_timer_add(sec, __time_tick_cb, data);
- __on_time_tick(&timeinfo, data);
+ /* Set a next timer */
+ sec = __get_next_tick_sec();
+ watch_tick = ecore_timer_add(sec, __time_tick_cb, data);
+ __on_time_tick(&timeinfo, data);
- if (timeinfo.timezone)
- free(timeinfo.timezone);
+ if (timeinfo.timezone)
+ free(timeinfo.timezone);
+ }
return ECORE_CALLBACK_CANCEL;
}
/* Cancel the time_tick callback */
__time_tick_cancel();
- appcore_efl_base_on_pause();
- if (__context.callback.pause)
- __context.callback.pause(__context.data);
+ if (__state == WS_RUNNING) {
+ appcore_efl_base_on_pause();
+ if (__context.callback.pause)
+ __context.callback.pause(__context.data);
+ }
__state = WS_PAUSED;
return APP_ERROR_NONE;
}
- if (__state != WS_PAUSED && __state != WS_CREATED) {
- _E("Invalid state");
- return APP_ERROR_NONE;
- }
-
- appcore_efl_base_on_resume();
-
if (__context.ambient_mode) {
__context.ambient_mode_skip_resume = false;
return 0;
}
+ if (__state != WS_PAUSED && __state != WS_CREATED)
+ return APP_ERROR_NONE;
+
+ appcore_efl_base_on_resume();
+
if (__context.callback.resume)
__context.callback.resume(__context.data);