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,
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;
......
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