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;
}
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;