Fix bug about screen connector 77/109177/2 accepted/tizen/3.0/common/20170111.161853 accepted/tizen/3.0/ivi/20170111.090452 accepted/tizen/3.0/mobile/20170111.090253 accepted/tizen/3.0/tv/20170111.090424 accepted/tizen/3.0/wearable/20170111.090439 submit/tizen_3.0/20170110.004324 submit/tizen_3.0/20170111.022947
authorHwankyu Jhun <h.jhun@samsung.com>
Mon, 9 Jan 2017 06:29:47 +0000 (15:29 +0900)
committerHwankyu Jhun <h.jhun@samsung.com>
Mon, 9 Jan 2017 06:33:23 +0000 (15:33 +0900)
If the provider app is already running, the viewer app
cannot get the app screen from the AMD.
Before sending the request, the viewer app should create
the app com handle.

Change-Id: I26b2112f98065ec334b26649350d726861a39fe1
Signed-off-by: Hwankyu Jhun <h.jhun@samsung.com>
src/aul_screen_connector.c

index e6a9a51..f844903 100644 (file)
@@ -177,18 +177,11 @@ static int __screen_viewer_init(void)
        if (screen_viewer_initialized)
                return 0;
 
-       ret = __add_screen_viewer();
-       if (ret < 0) {
-               _E("Failed to add screen watcher");
-               return -1;
-       }
-
        snprintf(endpoint, sizeof(endpoint), "app_screen_added:%d", pid);
        aul_app_com_create(endpoint, NULL, __app_screen_added,
                        NULL, &added_conn);
        if (added_conn == NULL) {
                _E("Failed to create app com - watch_app_added");
-               __screen_viewer_fini();
                return -1;
        }
 
@@ -201,6 +194,13 @@ static int __screen_viewer_init(void)
                return -1;
        }
 
+       ret = __add_screen_viewer();
+       if (ret < 0) {
+               _E("Failed to add screen watcher");
+               __screen_viewer_fini();
+               return -1;
+       }
+
        screen_viewer_initialized = true;
 
        return 0;