Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3212)

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/vr_shell/VrShellDelegate.java

Issue 2840353002: VR: Ensure initial paused state is set correctly for VrShellDelegate. (Closed)
Patch Set: Address comments Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/android/java/src/org/chromium/chrome/browser/vr_shell/VrShellDelegate.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/vr_shell/VrShellDelegate.java b/chrome/android/java/src/org/chromium/chrome/browser/vr_shell/VrShellDelegate.java
index 3bb6b02a9d729a5a752585a9e4ea839678e83285..4cd78912cd564e21d1cff36361fb5e85cf5a43c8 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/vr_shell/VrShellDelegate.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/vr_shell/VrShellDelegate.java
@@ -350,6 +350,8 @@ public class VrShellDelegate implements ApplicationStatus.ActivityStateListener,
private VrShellDelegate(ChromeActivity activity, VrClassesWrapper wrapper) {
mActivity = activity;
mVrClassesWrapper = wrapper;
+ // If an activity isn't resumed at the point, it must have been paused.
+ mPaused = ApplicationStatus.getStateForActivity(activity) != ActivityState.RESUMED;
updateVrSupportLevel();
mNativeVrShellDelegate = nativeInit();
Choreographer choreographer = Choreographer.getInstance();
@@ -375,6 +377,8 @@ public class VrShellDelegate implements ApplicationStatus.ActivityStateListener,
break;
case ActivityState.PAUSED:
if (activity == mActivity) pauseVr();
+ // Other activities should only pause while we're paused due to Android lifecycle.
+ assert mPaused;
break;
case ActivityState.RESUMED:
assert !mInVr;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698