Commit 11c92552 authored by Michael Thiessen's avatar Michael Thiessen Committed by Commit Bot

VR: Fix Headset insertion on N devices.

https://chromium-review.googlesource.com/c/chromium/src/+/1007922
failed to account for the animation cancel logic properly.

Bug: 831589
Change-Id: I46081899198e1381310c758bc9e6f937ddf1cd2f
Reviewed-on: https://chromium-review.googlesource.com/1010524Reviewed-by: default avatarYash Malik <ymalik@chromium.org>
Commit-Queue: Michael Thiessen <mthiesse@chromium.org>
Cr-Commit-Position: refs/heads/master@{#550249}
parent 97020572
......@@ -1900,6 +1900,7 @@ public class VrShellDelegate
mListeningForWebVrActivate = listening;
if (mListeningForWebVrActivate) {
registerDaydreamIntent(mActivity);
if (mNeedsAnimationCancel || mCancellingEntryAnimation) return;
if (mAutopresentWebVr || mActivateFromHeadsetInsertion) {
// Dispatch vrdisplayactivate so that the WebVr page can call requestPresent
// to start presentation.
......
......@@ -4,8 +4,6 @@
package org.chromium.chrome.browser.vr_shell;
import org.junit.Assert;
import org.chromium.base.ThreadUtils;
import org.chromium.chrome.browser.ChromeActivity;
......@@ -16,7 +14,6 @@ import org.chromium.chrome.browser.ChromeActivity;
* - Allows us to have test-specific behavior if necessary without changing production code
*/
public class TestVrShellDelegate extends VrShellDelegate {
private boolean mOnResumeCalled;
private Runnable mOnVSyncPausedCallback;
private static TestVrShellDelegate sInstance;
private boolean mDisableVrBrowsing;
......@@ -110,7 +107,6 @@ public class TestVrShellDelegate extends VrShellDelegate {
mTestWorkaroundDontCancelVrEntryOnResume = true;
}
super.onResume();
mOnResumeCalled = true;
mTestWorkaroundDontCancelVrEntryOnResume = false;
}
......@@ -132,19 +128,6 @@ public class TestVrShellDelegate extends VrShellDelegate {
return mExpectingBroadcast;
}
/**
* Make sure that onResume is called before onPause.
*
* This is necessary since we don't want weird problems to show up caused by the delayed
* onResume being called after onPause.
*/
@Override
protected void onPause() {
Assert.assertTrue(mOnResumeCalled);
mOnResumeCalled = false;
super.onPause();
}
/**
* If we need to know when the normal VSync gets paused, we have a small window between when
* the VrShell is created and we actually enter VR to set the callback. So, do it immediately
......
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