VR intent received twice on Android O |
|||||
Issue descriptionCertain intents can cause Chrome to enter VR mode upon startup. We have a VR launcher called VrMainActivity, which is essentially a wrapper around ChromeLauncherActiviy. It contains the necessary AndroidManifest entries to correctly transition Chrome into VR. This was added in this patch: https://chromium-review.googlesource.com/c/chromium/src/+/722456 Though, there is a bug on Android O. The intent is received twice by VrMainActivity for some reason. Here is a stack trace printed from LaunchIntentDispatcher#dispatch First call: java.lang.Exception at org.chromium.chrome.browser.LaunchIntentDispatcher.dispatch(LaunchIntentDispatcher.java:235) at org.chromium.chrome.browser.LaunchIntentDispatcher.dispatch(LaunchIntentDispatcher.java:110) at org.chromium.chrome.browser.document.ChromeLauncherActivity.onCreate(ChromeLauncherActivity.java:29) at android.app.Activity.performCreate(Activity.java:7013) at android.app.Activity.performCreate(Activity.java:7004) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1214) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2731) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2856) at android.app.ActivityThread.-wrap11(Unknown Source:0) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1589) at android.os.Handler.dispatchMessage(Handler.java:106) at android.os.Looper.loop(Looper.java:164) at android.app.ActivityThread.main(ActivityThread.java:6494) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807) Second call: java.lang.Exception at org.chromium.chrome.browser.LaunchIntentDispatcher.dispatch(LaunchIntentDispatcher.java:235) at org.chromium.chrome.browser.LaunchIntentDispatcher.dispatch(LaunchIntentDispatcher.java:110) at org.chromium.chrome.browser.document.ChromeLauncherActivity.onCreate(ChromeLauncherActivity.java:29) at android.app.Activity.performCreate(Activity.java:7013) at android.app.Activity.performCreate(Activity.java:7004) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1214) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2731) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2856) at android.app.ActivityThread.handleRelaunchActivity(ActivityThread.java:4699) at android.app.ActivityThread.-wrap18(Unknown Source:0) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1595) at android.os.Handler.dispatchMessage(Handler.java:106) at android.os.Looper.loop(Looper.java:164) at android.app.ActivityThread.main(ActivityThread.java:6494) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807) This can be tested by sending an intent via command line: adb shell am start -a android.intent.action.VIEW -n "org.chromium.chrome/org.chromium.chrome.browser.vr.VrMainActivity" --ez android.intent.extra.VR_LAUNCH true -d www.google.com Stack trace can be printed using: Log.e(TAG, Log.getStackTraceString(new Exception())) Either there's something wrong with the way VrMainActivity is declared (in the Manifest?), or there is some serious Android O bug. I verified that this doesn't happen for intents sent to ChromeLauncherActivity directly.
,
Jan 8 2018
,
Jan 16 2018
,
Jan 23 2018
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/5fa3e281fd5d48b801155d5aa8e328b3d8cfe1f2 commit 5fa3e281fd5d48b801155d5aa8e328b3d8cfe1f2 Author: Michael Thiessen <mthiesse@chromium.org> Date: Tue Jan 23 17:33:19 2018 VR: Prevent launcher recreation when handling VR intents. The launcher activities were getting recreated when handling VR intents as we set the VR mode as early as possible to avoid screen flickers. It's safe to handle density/vrmode config changes for the launcher activities as they're NoDisplay activities. Bug: 780673 Change-Id: I0456795f40099a4ec606262f37177f1950b733ad Reviewed-on: https://chromium-review.googlesource.com/868913 Commit-Queue: Michael Thiessen <mthiesse@chromium.org> Reviewed-by: Yaron Friedman <yfriedman@chromium.org> Cr-Commit-Position: refs/heads/master@{#531269} [modify] https://crrev.com/5fa3e281fd5d48b801155d5aa8e328b3d8cfe1f2/chrome/android/java/AndroidManifest.xml [modify] https://crrev.com/5fa3e281fd5d48b801155d5aa8e328b3d8cfe1f2/chrome/android/java/src/org/chromium/chrome/browser/vr_shell/VrShellDelegate.java
,
Jan 23 2018
,
Feb 8 2018
|
|||||
►
Sign in to add a comment |
|||||
Comment 1 by tedc...@chromium.org
, Nov 2 2017