Send pre resume when uniconify and lcd on 90/143590/1 submit/tizen_3.0/20170810.125114 submit/tizen_3.0/20170811.024642
authorHyunho Kang <hhstark.kang@samsung.com>
Thu, 10 Aug 2017 11:24:28 +0000 (20:24 +0900)
committerHyunho Kang <hhstark.kang@samsung.com>
Thu, 10 Aug 2017 11:25:02 +0000 (20:25 +0900)
Change-Id: Ic7c562ffb48ec97ec93d5fb6839038eab4e92d81
Signed-off-by: Hyunho Kang <hhstark.kang@samsung.com>
watch-control/src/control.c

index 6eec228adda1a7a47eb4682c268a49d52ac1386c..82911698aa4baf1b5be70417d3389f96a71cc0f8 100644 (file)
@@ -74,7 +74,7 @@ static unsigned int __watch_rid;
 static bool __manual_render;
 static bool __iconified = false;
 static bool __is_bound = false;
-static bool __viewer_visibility = false;
+static int __viewer_visibility = AUL_SCREEN_STATUS_PAUSE;
 
 static GList *__dead_cbs;
 struct dead_cb_s {
@@ -83,7 +83,7 @@ struct dead_cb_s {
 };
 
 GQueue *__pending_queue;
-static int __change_viewer_visibility(bool visible, bool update_cur_state);
+static int __change_viewer_visibility(int visibility, bool update_cur_state);
 static int __change_visibility(bool visible);
 static GDBusConnection *__gdbus_conn;
 static guint __lcd_subscribe_id;
@@ -161,7 +161,7 @@ static void __manual_render_start(void)
                return;
        }
 
-       __change_viewer_visibility(true, false);
+       __change_viewer_visibility(AUL_SCREEN_STATUS_PRE_RESUME, false);
        ecore_evas_manual_render_set(ee, EINA_TRUE);
 
        if (cur_image)
@@ -182,9 +182,6 @@ static void __manual_render_finish(void)
        ecore_evas_manual_render_set(ee, EINA_FALSE);
        LOGI("set manual false");
 
-       if (!__viewer_visibility)
-               __change_viewer_visibility(__viewer_visibility, false);
-
        auto_visibility = screen_connector_toolkit_evas_auto_visibility(__toolkit);
        if (auto_visibility == VISIBILITY_TYPE_PARTIALLY_OBSCURED ||
                        auto_visibility == VISIBILITY_TYPE_UNOBSCURED)
@@ -685,20 +682,14 @@ API int watch_manager_change_auto_visibility(bool enable)
        return 0;
 }
 
-static int __change_viewer_visibility(bool visible, bool update_cur_state)
+static int __change_viewer_visibility(int visibility, bool update_cur_state)
 {
        Evas_Object *watch;
-       int status;
        int r;
 
-       if (visible)
-               status = AUL_SCREEN_STATUS_RESUME;
-       else
-               status = AUL_SCREEN_STATUS_PAUSE;
-
        if (__win == NULL) {
                _E("Window is NULL");
-               __push_pending_queue(status);
+               __push_pending_queue(visibility);
                return 0;
        }
 
@@ -706,33 +697,33 @@ static int __change_viewer_visibility(bool visible, bool update_cur_state)
                watch = evas_object_data_get(__win, "tbm,watch");
                if (watch == NULL || __watch_appid == NULL) {
                        _E("watch is not added");
-                       __push_pending_queue(status);
+                       __push_pending_queue(visibility);
                        return 0;
                }
 
                screen_connector_toolkit_evas_get_rid(watch, (int *)&__watch_rid);
        }
 
-       r = aul_screen_connector_update_screen_viewer_status(status, __watch_rid);
+       r = aul_screen_connector_update_screen_viewer_status(visibility, __watch_rid);
        if (r < 0) {
                _E("Failed to update screen viewer status");
                return -1;
        }
-       _D("send watch control status to %s:%d", __watch_appid, status);
+       _D("send watch control status to %s:%d", __watch_appid, visibility);
        if (update_cur_state)
-               __viewer_visibility = visible;
+               __viewer_visibility = visibility;
 
        return 0;
 }
 
 API int watch_manager_notify_resumed_status_of_viewer(void)
 {
-       return __change_viewer_visibility(true, true);
+       return __change_viewer_visibility(AUL_SCREEN_STATUS_RESUME, true);
 }
 
 API int watch_manager_notify_paused_status_of_viewer(void)
 {
-       return __change_viewer_visibility(false, true);
+       return __change_viewer_visibility(AUL_SCREEN_STATUS_PAUSE, true);
 }
 
 static int __change_visibility(bool visible)