WM: Perform layout based on the requested flags
When the global system ui visibility changes, this clears certain sysui flags from windows. However, if we then use this value to perform layout, we might lay out the window in a way the app did not expect and that is not stable during transitions in and out of full screen. To fix this, always use the sysUiFl that the app provided in its window attributes, instead of using the window state's changing state. Change-Id: I5f9b3ed37be84553e9e2d912a102675beb6fc11a Fixes: 76084813 Test: Open Video in browser, enter full screen, play, press home. Verify transition into PiP is smooth.
This commit is contained in:
@@ -5078,7 +5078,7 @@ public class PhoneWindowManager implements WindowManagerPolicy {
|
||||
final int fl = PolicyControl.getWindowFlags(win, attrs);
|
||||
final int pfl = attrs.privateFlags;
|
||||
final int sim = attrs.softInputMode;
|
||||
final int requestedSysUiFl = PolicyControl.getSystemUiVisibility(win, null);
|
||||
final int requestedSysUiFl = PolicyControl.getSystemUiVisibility(null, attrs);
|
||||
final int sysUiFl = requestedSysUiFl | getImpliedSysUiFlagsForLayout(attrs);
|
||||
|
||||
final Rect pf = mTmpParentFrame;
|
||||
|
||||
@@ -65,7 +65,8 @@ public class PolicyControl {
|
||||
|
||||
public static int getSystemUiVisibility(WindowState win, LayoutParams attrs) {
|
||||
attrs = attrs != null ? attrs : win.getAttrs();
|
||||
int vis = win != null ? win.getSystemUiVisibility() : attrs.systemUiVisibility;
|
||||
int vis = win != null ? win.getSystemUiVisibility()
|
||||
: (attrs.systemUiVisibility | attrs.subtreeSystemUiVisibility);
|
||||
if (sImmersiveStatusFilter != null && sImmersiveStatusFilter.matches(attrs)) {
|
||||
vis |= View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY
|
||||
| View.SYSTEM_UI_FLAG_FULLSCREEN
|
||||
|
||||
Reference in New Issue
Block a user