Commit 97681b52 authored by mthiesse's avatar mthiesse Committed by Commit bot

VR: Ensure initial paused state is set correctly for VrShellDelegate.

BUG=715674

Review-Url: https://codereview.chromium.org/2840353002
Cr-Commit-Position: refs/heads/master@{#467859}
parent d2f9f9ff
...@@ -350,6 +350,8 @@ public class VrShellDelegate implements ApplicationStatus.ActivityStateListener, ...@@ -350,6 +350,8 @@ public class VrShellDelegate implements ApplicationStatus.ActivityStateListener,
private VrShellDelegate(ChromeActivity activity, VrClassesWrapper wrapper) { private VrShellDelegate(ChromeActivity activity, VrClassesWrapper wrapper) {
mActivity = activity; mActivity = activity;
mVrClassesWrapper = wrapper; mVrClassesWrapper = wrapper;
// If an activity isn't resumed at the point, it must have been paused.
mPaused = ApplicationStatus.getStateForActivity(activity) != ActivityState.RESUMED;
updateVrSupportLevel(); updateVrSupportLevel();
mNativeVrShellDelegate = nativeInit(); mNativeVrShellDelegate = nativeInit();
Choreographer choreographer = Choreographer.getInstance(); Choreographer choreographer = Choreographer.getInstance();
...@@ -375,6 +377,8 @@ public class VrShellDelegate implements ApplicationStatus.ActivityStateListener, ...@@ -375,6 +377,8 @@ public class VrShellDelegate implements ApplicationStatus.ActivityStateListener,
break; break;
case ActivityState.PAUSED: case ActivityState.PAUSED:
if (activity == mActivity) pauseVr(); if (activity == mActivity) pauseVr();
// Other activities should only pause while we're paused due to Android lifecycle.
assert mPaused;
break; break;
case ActivityState.RESUMED: case ActivityState.RESUMED:
assert !mInVr; assert !mInVr;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment