New issue
Advanced search Search tips

Issue 854740 link

Starred by 2 users

Issue metadata

Status: Fixed
Owner:
Closed: Aug 13
Components:
EstimatedDays: ----
NextAction: ----
OS: Android
Pri: 2
Type: Bug
Proj-VR
Proj-XR
Proj-XR-VR



Sign in to add a comment

VR mode stays on when Chrome is killed in the background while in VR

Project Member Reported by mthiesse@chromium.org, Jun 20 2018

Issue description

If Chrome is launched from recents, and was in VR, we ignore the fact that the intent was a VR intent, as the user can't have been in VR and probably wanted to use Chrome in 2D.

However, this means we never end up turning VR Mode off for the activity, and we end up with the low-persistance display effect on for 2D Chrome.

Probably not worth merging back to 68 at this point - this issue has probably been around forever.
 
Labels: -M-69 Target-70
It's actually pretty complicated to know whether Chrome should be in VR after getting killed/recreated. Targeting 70.
Labels: -Target-70 Target-69
Looks like a bunch of Reddit users are running into an issue that is most likely related to this. (https://www.reddit.com/r/daydream/comments/94ahk4/chrome_keeps_starting_in_vr_mode_problem_anyone/)

I'll make sure we turn VR mode off when restoring from a saved instance - if we fail to enter VR when we should have been in VR because of Android killing our Activity instance, oh well, that's always been broken.
Project Member

Comment 3 by bugdroid1@chromium.org, Aug 9

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/a0ba0c66cc865164bcbed086d9e21b995981c197

commit a0ba0c66cc865164bcbed086d9e21b995981c197
Author: Michael Thiessen <mthiesse@chromium.org>
Date: Thu Aug 09 23:39:28 2018

VR: Turn VR mode off when restoring Activity from saved instance.

When Chrome is killed in the background while VR mode is on, we can't
turn VR mode off (the platform doesn't respect VR mode changes for
backgrounded apps).

We also can't check whether VR mode is currently on on Android N, so
instead this CL records whether we were in VR mode when killed using
saved instance state, and turns VR mode off on startup when restoring.

Test/Repro steps:
1. Turn on "Don't keep activities" in developer settings
2. Launch Chrome in VR
3. Press the Daydream controller Home button
4. Exit VR
5. Use task switcher to return to Chrome.

> Chrome should resume without VR mode on (the display will flicker
if it's on)

Bug:  854740 
Change-Id: I4fc8e9c076a8cb31ca2bdb74be1124bec3826193
Reviewed-on: https://chromium-review.googlesource.com/1167116
Commit-Queue: Michael Thiessen <mthiesse@chromium.org>
Reviewed-by: Yaron Friedman <yfriedman@chromium.org>
Cr-Commit-Position: refs/heads/master@{#581957}
[modify] https://crrev.com/a0ba0c66cc865164bcbed086d9e21b995981c197/chrome/android/java/src/org/chromium/chrome/browser/ChromeActivity.java
[modify] https://crrev.com/a0ba0c66cc865164bcbed086d9e21b995981c197/chrome/android/java/src/org/chromium/chrome/browser/vr/VrDelegate.java
[modify] https://crrev.com/a0ba0c66cc865164bcbed086d9e21b995981c197/chrome/android/java/src/org/chromium/chrome/browser/vr/VrDelegateFallback.java
[modify] https://crrev.com/a0ba0c66cc865164bcbed086d9e21b995981c197/chrome/android/java/src/org/chromium/chrome/browser/vr/VrDelegateImpl.java
[modify] https://crrev.com/a0ba0c66cc865164bcbed086d9e21b995981c197/chrome/android/java/src/org/chromium/chrome/browser/vr/VrShellDelegate.java

Labels: Merge-Request-69
Verified on Canary.
Project Member

Comment 5 by sheriffbot@chromium.org, Aug 13

Labels: -Merge-Request-69 Merge-Review-69 Hotlist-Merge-Review
This bug requires manual review: M69 has already been promoted to the beta branch, so this requires manual review
Please contact the milestone owner if you have questions.
Owners: amineer@(Android), kariahda@(iOS), cindyb@(ChromeOS), govind@(Desktop)

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
Labels: -Merge-Review-69 Merge-Approved-69
Project Member

Comment 7 by bugdroid1@chromium.org, Aug 13

Labels: -merge-approved-69 merge-merged-3497
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/0172ac718372cd2ba0bcfc03f699f49a1de0887f

commit 0172ac718372cd2ba0bcfc03f699f49a1de0887f
Author: Michael Thiessen <mthiesse@chromium.org>
Date: Mon Aug 13 20:17:36 2018

VR: Turn VR mode off when restoring Activity from saved instance.

When Chrome is killed in the background while VR mode is on, we can't
turn VR mode off (the platform doesn't respect VR mode changes for
backgrounded apps).

We also can't check whether VR mode is currently on on Android N, so
instead this CL records whether we were in VR mode when killed using
saved instance state, and turns VR mode off on startup when restoring.

Test/Repro steps:
1. Turn on "Don't keep activities" in developer settings
2. Launch Chrome in VR
3. Press the Daydream controller Home button
4. Exit VR
5. Use task switcher to return to Chrome.

> Chrome should resume without VR mode on (the display will flicker
if it's on)

TBR=mthiesse@chromium.org

(cherry picked from commit a0ba0c66cc865164bcbed086d9e21b995981c197)

Bug:  854740 
Change-Id: I4fc8e9c076a8cb31ca2bdb74be1124bec3826193
Reviewed-on: https://chromium-review.googlesource.com/1167116
Commit-Queue: Michael Thiessen <mthiesse@chromium.org>
Reviewed-by: Yaron Friedman <yfriedman@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#581957}
Reviewed-on: https://chromium-review.googlesource.com/1173323
Reviewed-by: Michael Thiessen <mthiesse@chromium.org>
Cr-Commit-Position: refs/branch-heads/3497@{#582}
Cr-Branched-From: 271eaf50594eb818c9295dc78d364aea18c82ea8-refs/heads/master@{#576753}
[modify] https://crrev.com/0172ac718372cd2ba0bcfc03f699f49a1de0887f/chrome/android/java/src/org/chromium/chrome/browser/ChromeActivity.java
[modify] https://crrev.com/0172ac718372cd2ba0bcfc03f699f49a1de0887f/chrome/android/java/src/org/chromium/chrome/browser/vr/VrDelegate.java
[modify] https://crrev.com/0172ac718372cd2ba0bcfc03f699f49a1de0887f/chrome/android/java/src/org/chromium/chrome/browser/vr/VrDelegateFallback.java
[modify] https://crrev.com/0172ac718372cd2ba0bcfc03f699f49a1de0887f/chrome/android/java/src/org/chromium/chrome/browser/vr/VrDelegateImpl.java
[modify] https://crrev.com/0172ac718372cd2ba0bcfc03f699f49a1de0887f/chrome/android/java/src/org/chromium/chrome/browser/vr/VrShellDelegate.java

Status: Fixed (was: Started)
Project Member

Comment 9 by bugdroid1@chromium.org, Aug 14

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/45edcd470bb1b8b5f643a06812b351d537edc52b

commit 45edcd470bb1b8b5f643a06812b351d537edc52b
Author: Ben Mason <benmason@chromium.org>
Date: Tue Aug 14 05:22:10 2018

Revert "VR: Turn VR mode off when restoring Activity from saved instance."

This reverts commit 0172ac718372cd2ba0bcfc03f699f49a1de0887f.

Reason for revert: <INSERT REASONING HERE>

Original change's description:
> VR: Turn VR mode off when restoring Activity from saved instance.
> 
> When Chrome is killed in the background while VR mode is on, we can't
> turn VR mode off (the platform doesn't respect VR mode changes for
> backgrounded apps).
> 
> We also can't check whether VR mode is currently on on Android N, so
> instead this CL records whether we were in VR mode when killed using
> saved instance state, and turns VR mode off on startup when restoring.
> 
> Test/Repro steps:
> 1. Turn on "Don't keep activities" in developer settings
> 2. Launch Chrome in VR
> 3. Press the Daydream controller Home button
> 4. Exit VR
> 5. Use task switcher to return to Chrome.
> 
> > Chrome should resume without VR mode on (the display will flicker
> if it's on)
> 
> TBR=mthiesse@chromium.org
> 
> (cherry picked from commit a0ba0c66cc865164bcbed086d9e21b995981c197)
> 
> Bug:  854740 
> Change-Id: I4fc8e9c076a8cb31ca2bdb74be1124bec3826193
> Reviewed-on: https://chromium-review.googlesource.com/1167116
> Commit-Queue: Michael Thiessen <mthiesse@chromium.org>
> Reviewed-by: Yaron Friedman <yfriedman@chromium.org>
> Cr-Original-Commit-Position: refs/heads/master@{#581957}
> Reviewed-on: https://chromium-review.googlesource.com/1173323
> Reviewed-by: Michael Thiessen <mthiesse@chromium.org>
> Cr-Commit-Position: refs/branch-heads/3497@{#582}
> Cr-Branched-From: 271eaf50594eb818c9295dc78d364aea18c82ea8-refs/heads/master@{#576753}

TBR=yfriedman@chromium.org,mthiesse@chromium.org

Change-Id: I5c11ef0001b678e112b17358c6b71329e307b2e7
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug:  854740 
Reviewed-on: https://chromium-review.googlesource.com/1174031
Reviewed-by: Ben Mason <benmason@chromium.org>
Cr-Commit-Position: refs/branch-heads/3497@{#609}
Cr-Branched-From: 271eaf50594eb818c9295dc78d364aea18c82ea8-refs/heads/master@{#576753}
[modify] https://crrev.com/45edcd470bb1b8b5f643a06812b351d537edc52b/chrome/android/java/src/org/chromium/chrome/browser/ChromeActivity.java
[modify] https://crrev.com/45edcd470bb1b8b5f643a06812b351d537edc52b/chrome/android/java/src/org/chromium/chrome/browser/vr/VrDelegate.java
[modify] https://crrev.com/45edcd470bb1b8b5f643a06812b351d537edc52b/chrome/android/java/src/org/chromium/chrome/browser/vr/VrDelegateFallback.java
[modify] https://crrev.com/45edcd470bb1b8b5f643a06812b351d537edc52b/chrome/android/java/src/org/chromium/chrome/browser/vr/VrDelegateImpl.java
[modify] https://crrev.com/45edcd470bb1b8b5f643a06812b351d537edc52b/chrome/android/java/src/org/chromium/chrome/browser/vr/VrShellDelegate.java

Project Member

Comment 10 by bugdroid1@chromium.org, Aug 14

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/fa425e0ca006703ae95102d128978722dbd005e8

commit fa425e0ca006703ae95102d128978722dbd005e8
Author: Michael Thiessen <mthiesse@chromium.org>
Date: Tue Aug 14 15:03:50 2018

Reland "VR: Turn VR mode off when restoring Activity from saved instance."

This reverts commit 45edcd470bb1b8b5f643a06812b351d537edc52b.

Reason for revert: Fixing build and re-landing.

Original change's description:
> Revert "VR: Turn VR mode off when restoring Activity from saved instance."
> 
> This reverts commit 0172ac718372cd2ba0bcfc03f699f49a1de0887f.
> 
> Reason for revert: <INSERT REASONING HERE>
> 
> Original change's description:
> > VR: Turn VR mode off when restoring Activity from saved instance.
> > 
> > When Chrome is killed in the background while VR mode is on, we can't
> > turn VR mode off (the platform doesn't respect VR mode changes for
> > backgrounded apps).
> > 
> > We also can't check whether VR mode is currently on on Android N, so
> > instead this CL records whether we were in VR mode when killed using
> > saved instance state, and turns VR mode off on startup when restoring.
> > 
> > Test/Repro steps:
> > 1. Turn on "Don't keep activities" in developer settings
> > 2. Launch Chrome in VR
> > 3. Press the Daydream controller Home button
> > 4. Exit VR
> > 5. Use task switcher to return to Chrome.
> > 
> > > Chrome should resume without VR mode on (the display will flicker
> > if it's on)
> > 
> > TBR=mthiesse@chromium.org
> > 
> > (cherry picked from commit a0ba0c66cc865164bcbed086d9e21b995981c197)
> > 
> > Bug:  854740 
> > Change-Id: I4fc8e9c076a8cb31ca2bdb74be1124bec3826193
> > Reviewed-on: https://chromium-review.googlesource.com/1167116
> > Commit-Queue: Michael Thiessen <mthiesse@chromium.org>
> > Reviewed-by: Yaron Friedman <yfriedman@chromium.org>
> > Cr-Original-Commit-Position: refs/heads/master@{#581957}
> > Reviewed-on: https://chromium-review.googlesource.com/1173323
> > Reviewed-by: Michael Thiessen <mthiesse@chromium.org>
> > Cr-Commit-Position: refs/branch-heads/3497@{#582}
> > Cr-Branched-From: 271eaf50594eb818c9295dc78d364aea18c82ea8-refs/heads/master@{#576753}
> 
> TBR=yfriedman@chromium.org,mthiesse@chromium.org
> 
> Change-Id: I5c11ef0001b678e112b17358c6b71329e307b2e7
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug:  854740 
> Reviewed-on: https://chromium-review.googlesource.com/1174031
> Reviewed-by: Ben Mason <benmason@chromium.org>
> Cr-Commit-Position: refs/branch-heads/3497@{#609}
> Cr-Branched-From: 271eaf50594eb818c9295dc78d364aea18c82ea8-refs/heads/master@{#576753}

TBR=yfriedman@chromium.org,mthiesse@chromium.org,benmason@chromium.org

Change-Id: I8dd8cd0ffc194164a9edf52fccaefeab0241d139
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug:  854740 
Reviewed-on: https://chromium-review.googlesource.com/1174731
Reviewed-by: Michael Thiessen <mthiesse@chromium.org>
Cr-Commit-Position: refs/branch-heads/3497@{#616}
Cr-Branched-From: 271eaf50594eb818c9295dc78d364aea18c82ea8-refs/heads/master@{#576753}
[modify] https://crrev.com/fa425e0ca006703ae95102d128978722dbd005e8/chrome/android/java/src/org/chromium/chrome/browser/ChromeActivity.java
[modify] https://crrev.com/fa425e0ca006703ae95102d128978722dbd005e8/chrome/android/java/src/org/chromium/chrome/browser/vr/VrDelegate.java
[modify] https://crrev.com/fa425e0ca006703ae95102d128978722dbd005e8/chrome/android/java/src/org/chromium/chrome/browser/vr/VrDelegateFallback.java
[modify] https://crrev.com/fa425e0ca006703ae95102d128978722dbd005e8/chrome/android/java/src/org/chromium/chrome/browser/vr/VrDelegateImpl.java
[modify] https://crrev.com/fa425e0ca006703ae95102d128978722dbd005e8/chrome/android/java/src/org/chromium/chrome/browser/vr/VrShellDelegate.java

Sign in to add a comment