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

Commit 2e6e4355 authored by Yunfan Chen's avatar Yunfan Chen
Browse files

Do not let snapshot window control the bar

The snapshot window will sometime take over the system bar control as
the top fullscreen opaque window. To avoid the window take the control
if the window is not focusable to avoid the bar flickering issue when
the snapshot window has a different insets visibility with the current
controller.

Test: Launch sticky immersive app from recent. The bar hidden animation
      works correctly. No flickering.
Test: atest MultiDisplayPolicyTests
Test: ActivityStarterTests
Bug: 203017444
Change-Id: I3d7ba6b7d78c0508ddeccbf1d3408d723bd8e2c0
parent bb6c39d3
Loading
Loading
Loading
Loading
+7 −2
Original line number Diff line number Diff line
@@ -2665,10 +2665,15 @@ public class DisplayPolicy {
    }

    void updateSystemBarAttributes() {
        WindowState winCandidate = mFocusedWindow;
        if (winCandidate == null && mTopFullscreenOpaqueWindowState != null
                && (mTopFullscreenOpaqueWindowState.mAttrs.flags
                & WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE) == 0) {
            // Only focusable window can take system bar control.
            winCandidate = mTopFullscreenOpaqueWindowState;
        }
        // If there is no window focused, there will be nobody to handle the events
        // anyway, so just hang on in whatever state we're in until things settle down.
        WindowState winCandidate = mFocusedWindow != null ? mFocusedWindow
                : mTopFullscreenOpaqueWindowState;
        if (winCandidate == null) {
            return;
        }