OSDN Git Service

vrwm: Handle intents launched by the VR app
authorAlbert Chaulk <achaulk@google.com>
Thu, 6 Apr 2017 20:36:29 +0000 (16:36 -0400)
committerAlbert Chaulk <achaulk@google.com>
Thu, 6 Apr 2017 21:36:10 +0000 (17:36 -0400)
This gives us the following cases
Same appid, vr mode = 1: normal use
Same appid, vr mode = 0: VR app 2D intent
Different appid, vr mode = 1: Switching apps
Different appid, vr mode = 0: 2D app

Bug: 37099690
Test: Manual with calculator and oobetest
Change-Id: I7ba6588fb80d4c8de4f1372d047682f1d5d54860

services/vr/vr_window_manager/display_view.cpp

index 52984b7..88768a0 100644 (file)
@@ -219,6 +219,11 @@ base::unique_fd DisplayView::OnFrame(std::unique_ptr<HwcCallback::Frame> frame,
       visibility = ViewMode::Hidden;
       current_vr_app_ = app;
     }
+  } else if ((use_2dmode_ || !is_vr_active) && app != 0 &&
+             visibility == ViewMode::Hidden) {
+    // This is the case for the VR app launching a 2D intent of itself on some
+    // display.
+    visibility = ViewMode::App;
   } else if (!current_vr_app_) {
     // The VR app is running.
     current_vr_app_ = app;