New issue
Advanced search Search tips

Issue 659674 link

Starred by 1 user

Issue metadata

Status: Available
Owner: ----
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Android
Pri: 3
Type: Task



Sign in to add a comment

[Android N Multi-window] Make ScreenOrientationProvider MultiWindow/MultiDisplay aware

Project Member Reported by mthiesse@chromium.org, Oct 26 2016

Issue description

ScreenOrientationProvider is clearly not MultiWindow aware, and looks like it will fail in strange ways with MultiWindow/MultiDisplay.

Especially bad is its use of ApplicationStatus.getLastTrackedFocusedActivity() to determine which Activity's orientation to lock/unlock.
 

Comment 1 by boliu@chromium.org, Oct 26 2016

Cc: mlamouri@chromium.org

Comment 2 by boliu@chromium.org, Oct 26 2016

also it's probably broken already since chrome added ability to reparent tabs
All of that did not exist at the time :( I was hoping the multi-window project to take care of Screen Orientation API. boliu@, do you intend to fix this? :)

Comment 4 by boliu@chromium.org, Oct 26 2016

multiwindow vs multidisplay, not the same thing, multi window is already implemented, ie CCT and the reparenting logic

anyway, I'm not sure entirely how things should behave, what happens when a tab is reparented to a different activity (which can happen today already)? what happens when a tab is reparented to a different activity on a different display (can't happen, yet)?

Is there js callback that says "oops, you just lost your orientation lock" kind of thing?
There is no such API but the `screen` object in JS only reflects the current screen so if the window changes display, the lock would no longer apply indeed.

How does this work with the Android API?

Comment 6 by boliu@chromium.org, Oct 26 2016

android activities are not allowed to move between displays (afaik)
Project Member

Comment 7 by sheriffbot@chromium.org, Oct 27 2017

Labels: Hotlist-Recharge-Cold
Status: Untriaged (was: Available)
This issue has been Available for over a year. If it's no longer important or seems unlikely to be fixed, please consider closing it out. If it is important, please re-triage the issue.

Sorry for the inconvenience if the bug really should have been left as Available. If you change it back, also remove the "Hotlist-Recharge-Cold" label.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
Cc: tedc...@chromium.org
+tedchoc@, is this something our team could consider?
This patch fixed it from using the last tracked activity to getting one from the window android:

https://codereview.chromium.org/2696303004

So maybe this is fixed?

What is the relationship between web contents and the screen orientation provider?  Is it 1:1 or is there one provider for the entire process?

There was an open comment in that bug where reparenting could change the activity and cause issue if you locked the orientation in one and then were moved and attempted to unlock in another.  I think conceptually we'd want to use a WindowAndroidChangedObserver and keep a list of web contents references or something to help track across activities.  Then again, I'm not sure how much work that would be vs the likelihood of it ever being hit.

Comment 10 by boliu@chromium.org, Oct 27 2017

ScreenOrientationProvider only has static methods, so it's global

the refactor is probably to remove ScreenOrientationProvider altogether, and add orientation events to DisplayAndroid, and hook all the existing things that uses ScreenOrientationProvider to the new thing
Labels: android-fe-triaged
Status: Available (was: Untriaged)
Labels: -Type-Bug Type-Task

Sign in to add a comment