Set viewer visibility when start app 46/151246/1
authorHyunho Kang <hhstark.kang@samsung.com>
Thu, 17 Aug 2017 08:23:06 +0000 (17:23 +0900)
committerHyunho Kang <hhstark.kang@samsung.com>
Wed, 20 Sep 2017 08:28:47 +0000 (17:28 +0900)
Change-Id: I02467606b40683fdc562ac2aac8187d4ccc50b69
Signed-off-by: Hyunho Kang <hhstark.kang@samsung.com>
src/watch_app_main.c

index 8d5ff29..65e59cf 100755 (executable)
@@ -638,7 +638,10 @@ static void __on_ambient_changed(int ambient, void *data)
 static void __on_window_show(int type, void *event, void *data)
 {
        appcore_efl_base_window_on_show(type, event);
-       appcore_efl_base_resume();
+       if (__context.viewer_visibility == AUL_SCREEN_STATUS_RESUME)
+               appcore_efl_base_resume();
+       else
+               _D("viewer is not resumed, do not resume watch");
 }
 
 static void __on_window_visibility(int type, void *event, void *data)
@@ -755,6 +758,7 @@ EXPORT_API int watch_app_main(int argc, char **argv,
        int width = 360;
        int height = 360;
        appcore_efl_base_ops ops = appcore_efl_base_get_default_ops();
+       char *viewer_visibility_str = NULL;
 
        /* override methods */
        ops.ui_base.base.create = __on_create;
@@ -769,6 +773,8 @@ EXPORT_API int watch_app_main(int argc, char **argv,
        if (kb) {
                bundle_get_str(kb, "WATCH_WIDTH", &width_str);
                bundle_get_str(kb, "WATCH_HEIGHT", &height_str);
+               bundle_get_str(kb, "WATCH_VIEWER_VISIBILITY",
+                               &viewer_visibility_str);
 
                if (width_str)
                        width = atoi(width_str);
@@ -776,6 +782,11 @@ EXPORT_API int watch_app_main(int argc, char **argv,
                if (height_str)
                        height = atoi(height_str);
 
+               if (viewer_visibility_str) {
+                       __context.viewer_visibility =
+                                       atoi(viewer_visibility_str);
+               }
+
                bundle_free(kb);
        } else {
                _E("failed to get launch argv");
@@ -811,7 +822,6 @@ EXPORT_API int watch_app_main(int argc, char **argv,
        __context.callback = *callback;
        __context.width = width;
        __context.height = height;
-       __context.viewer_visibility = AUL_SCREEN_STATUS_RESUME;
        __context.watch_visibility = WVS_UNKNOWN;
        __context.ambient_mode = false;
        __context.ambient_mode_skip_resume = false;