Change condition to call manual_render_start from AppControl Event & object move... 97/225697/1
authorChangwoo KIM <cw2010.kim@samsung.com>
Thu, 28 Nov 2019 08:18:07 +0000 (17:18 +0900)
committerhyunho <hhstark.kang@samsung.com>
Mon, 24 Feb 2020 04:36:38 +0000 (13:36 +0900)
Check LCD state. If it is Off do not resume watchface, skip manual render

Change-Id: I457bc78234227e6960dbb0c62dd4bda122531412
Signed-off-by: hyunho <hhstark.kang@samsung.com>
watch-control/src/control.c

index 32a5027..3cd3764 100644 (file)
@@ -167,10 +167,8 @@ static void __manual_render_start(bool force_resume)
        __manual_render.started = true;
 
        if (force_resume) {
-               if (__lcd_is_on()) {
-                       _W("Force resume watchface");
-                       watch_manager_notify_resumed_status_of_viewer();
-               }
+               _W("Force resume watchface");
+               watch_manager_notify_resumed_status_of_viewer();                
        }
 }
 
@@ -188,11 +186,10 @@ static void __manual_render_stop(void)
 
 static void __aul_watch_control_cb(bundle *b, void *user_data)
 {
-       bool v = __watch_is_visible();
-
-       if (!v)
-               return;
-       __manual_render_start(true);
+       if (__lcd_is_on()) {
+               _I("App control manual render");
+               __manual_render_start(true);
+       }
 }
 
 static gboolean __force_resume_cb(gpointer data)
@@ -204,12 +201,16 @@ static gboolean __force_resume_cb(gpointer data)
 static void __obj_move_cb(void *data, Evas *e, Evas_Object *obj,
                void *event_info)
 {
-       bool v = __watch_is_visible();
-
-       if (!v)
-               return;
-       __manual_render_start(true);
-       g_idle_add(__force_resume_cb, NULL);
+       if (__watch_is_visible() && __lcd_is_on()) {
+               _I("Move manual render");
+               /*
+                 If force_resume is true, it will make resume status for Viewer/Watchface both.
+                 If force_resume is false, it will resume Watchface only when Viewer is on resume status.
+                 Viewer can move watch object on background. So just pass false, leave Viewer decide resume status of watchface
+               */
+               __manual_render_start(false);
+               g_idle_add(__force_resume_cb, NULL);
+       }
 }
 
 static Eina_Bool __window_on_pre_visibility(void *data, int type, void *event)