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 ...@@ -1900,6 +1900,7 @@ public class VrShellDelegate
mListeningForWebVrActivate = listening; mListeningForWebVrActivate = listening;
if (mListeningForWebVrActivate) { if (mListeningForWebVrActivate) {
registerDaydreamIntent(mActivity); registerDaydreamIntent(mActivity);
if (mNeedsAnimationCancel || mCancellingEntryAnimation) return;
if (mAutopresentWebVr || mActivateFromHeadsetInsertion) { if (mAutopresentWebVr || mActivateFromHeadsetInsertion) {
// Dispatch vrdisplayactivate so that the WebVr page can call requestPresent // Dispatch vrdisplayactivate so that the WebVr page can call requestPresent
// to start presentation. // to start presentation.
......
...@@ -4,8 +4,6 @@ ...@@ -4,8 +4,6 @@
package org.chromium.chrome.browser.vr_shell; package org.chromium.chrome.browser.vr_shell;
import org.junit.Assert;
import org.chromium.base.ThreadUtils; import org.chromium.base.ThreadUtils;
import org.chromium.chrome.browser.ChromeActivity; import org.chromium.chrome.browser.ChromeActivity;
...@@ -16,7 +14,6 @@ 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 * - Allows us to have test-specific behavior if necessary without changing production code
*/ */
public class TestVrShellDelegate extends VrShellDelegate { public class TestVrShellDelegate extends VrShellDelegate {
private boolean mOnResumeCalled;
private Runnable mOnVSyncPausedCallback; private Runnable mOnVSyncPausedCallback;
private static TestVrShellDelegate sInstance; private static TestVrShellDelegate sInstance;
private boolean mDisableVrBrowsing; private boolean mDisableVrBrowsing;
...@@ -110,7 +107,6 @@ public class TestVrShellDelegate extends VrShellDelegate { ...@@ -110,7 +107,6 @@ public class TestVrShellDelegate extends VrShellDelegate {
mTestWorkaroundDontCancelVrEntryOnResume = true; mTestWorkaroundDontCancelVrEntryOnResume = true;
} }
super.onResume(); super.onResume();
mOnResumeCalled = true;
mTestWorkaroundDontCancelVrEntryOnResume = false; mTestWorkaroundDontCancelVrEntryOnResume = false;
} }
...@@ -132,19 +128,6 @@ public class TestVrShellDelegate extends VrShellDelegate { ...@@ -132,19 +128,6 @@ public class TestVrShellDelegate extends VrShellDelegate {
return mExpectingBroadcast; 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 * 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 * 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