#include "home_mgr.h"
#include "process_mgr.h"
+#define GO_TO_WATCH_TIME 20
int errno;
-
static struct {
int lcd_status;
+ Ecore_Timer *go_watch_timer;
} s_starter = {
.lcd_status = -1,
+ .go_watch_timer = NULL,
};
if (lcd_on) {
_W("LCD on");
s_starter.lcd_status = 1;
+
+ if (s_starter.go_watch_timer) {
+ ecore_timer_del(s_starter.go_watch_timer);
+ s_starter.go_watch_timer = NULL;
+ }
} else if (lcd_off) {
_W("LCD off");
s_starter.lcd_status = 0;
- if (!ecore_timer_add(20, _go_to_watch_after_screenoff_cb, NULL)) {
+
+ if (s_starter.go_watch_timer) {
+ ecore_timer_del(s_starter.go_watch_timer);
+ s_starter.go_watch_timer = NULL;
+ }
+
+ s_starter.go_watch_timer = ecore_timer_add(GO_TO_WATCH_TIME, _go_to_watch_after_screenoff_cb, NULL);
+ if (!s_starter.go_watch_timer) {
_E("Falied to add timer for launching watch face after screenoff");
}
} else {