Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4bb17ec3 authored by Adrian Roos's avatar Adrian Roos
Browse files

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.
parent 6d084215
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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;
+2 −1
Original line number Diff line number Diff line
@@ -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