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

Commit e8c4a810 authored by Alex Stetson's avatar Alex Stetson Committed by Automerger Merge Worker
Browse files

Merge "Mark system bars as consumed when using remote insets" into tm-qpr-dev...

Merge "Mark system bars as consumed when using remote insets" into tm-qpr-dev am: dd8e7909 am: 1af0684a

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/19785182



Change-Id: Iadb80aa210cd4a3ca9e371a422ec93aa803cc1b6
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 9385325d 1af0684a
Loading
Loading
Loading
Loading
+12 −0
Original line number Original line Diff line number Diff line
@@ -362,6 +362,7 @@ public class DisplayPolicy {
    private WindowState mTopFullscreenOpaqueWindowState;
    private WindowState mTopFullscreenOpaqueWindowState;
    private boolean mTopIsFullscreen;
    private boolean mTopIsFullscreen;
    private int mNavBarOpacityMode = NAV_BAR_OPAQUE_WHEN_FREEFORM_OR_DOCKED;
    private int mNavBarOpacityMode = NAV_BAR_OPAQUE_WHEN_FREEFORM_OR_DOCKED;
    private boolean mForceConsumeSystemBars;
    private boolean mForceShowSystemBars;
    private boolean mForceShowSystemBars;


    private boolean mShowingDream;
    private boolean mShowingDream;
@@ -1560,6 +1561,13 @@ public class DisplayPolicy {
        return ANIMATION_STYLEABLE;
        return ANIMATION_STYLEABLE;
    }
    }


    /**
     * @return true if the system bars are forced to be consumed
     */
    public boolean areSystemBarsForcedConsumedLw() {
        return mForceConsumeSystemBars;
    }

    /**
    /**
     * @return true if the system bars are forced to stay visible
     * @return true if the system bars are forced to stay visible
     */
     */
@@ -2462,6 +2470,10 @@ public class DisplayPolicy {
        // We need to force showing system bars when the multi-window or freeform root task is
        // We need to force showing system bars when the multi-window or freeform root task is
        // visible.
        // visible.
        mForceShowSystemBars = multiWindowTaskVisible || freeformRootTaskVisible;
        mForceShowSystemBars = multiWindowTaskVisible || freeformRootTaskVisible;
        // We need to force the consumption of the system bars if they are force shown or if they
        // are controlled by a remote insets controller.
        mForceConsumeSystemBars = mForceShowSystemBars
                || mDisplayContent.getInsetsPolicy().remoteInsetsControllerControlsSystemBars(win);
        mDisplayContent.getInsetsPolicy().updateBarControlTarget(win);
        mDisplayContent.getInsetsPolicy().updateBarControlTarget(win);


        final boolean topAppHidesStatusBar = topAppHidesStatusBar();
        final boolean topAppHidesStatusBar = topAppHidesStatusBar();
+3 −3
Original line number Original line Diff line number Diff line
@@ -1808,7 +1808,7 @@ public class WindowManagerService extends IWindowManager.Stub
                prepareNoneTransitionForRelaunching(activity);
                prepareNoneTransitionForRelaunching(activity);
            }
            }


            if (displayPolicy.areSystemBarsForcedShownLw()) {
            if (displayPolicy.areSystemBarsForcedConsumedLw()) {
                res |= WindowManagerGlobal.ADD_FLAG_ALWAYS_CONSUME_SYSTEM_BARS;
                res |= WindowManagerGlobal.ADD_FLAG_ALWAYS_CONSUME_SYSTEM_BARS;
            }
            }


@@ -2527,7 +2527,7 @@ public class WindowManagerService extends IWindowManager.Stub
            if (win.mActivityRecord != null) {
            if (win.mActivityRecord != null) {
                win.mActivityRecord.updateReportedVisibilityLocked();
                win.mActivityRecord.updateReportedVisibilityLocked();
            }
            }
            if (displayPolicy.areSystemBarsForcedShownLw()) {
            if (displayPolicy.areSystemBarsForcedConsumedLw()) {
                result |= WindowManagerGlobal.RELAYOUT_RES_CONSUME_ALWAYS_SYSTEM_BARS;
                result |= WindowManagerGlobal.RELAYOUT_RES_CONSUME_ALWAYS_SYSTEM_BARS;
            }
            }
            if (!win.isGoneForLayout()) {
            if (!win.isGoneForLayout()) {
@@ -8896,7 +8896,7 @@ public class WindowManagerService extends IWindowManager.Stub
                            : overrideScale;
                            : overrideScale;
                    outInsetsState.scale(1f / compatScale);
                    outInsetsState.scale(1f / compatScale);
                }
                }
                return dc.getDisplayPolicy().areSystemBarsForcedShownLw();
                return dc.getDisplayPolicy().areSystemBarsForcedConsumedLw();
            }
            }
        } finally {
        } finally {
            Binder.restoreCallingIdentity(origId);
            Binder.restoreCallingIdentity(origId);
+1 −1
Original line number Original line Diff line number Diff line
@@ -3917,7 +3917,7 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP
        final boolean forceRelayout = syncWithBuffers || isDragResizeChanged;
        final boolean forceRelayout = syncWithBuffers || isDragResizeChanged;
        final DisplayContent displayContent = getDisplayContent();
        final DisplayContent displayContent = getDisplayContent();
        final boolean alwaysConsumeSystemBars =
        final boolean alwaysConsumeSystemBars =
                displayContent.getDisplayPolicy().areSystemBarsForcedShownLw();
                displayContent.getDisplayPolicy().areSystemBarsForcedConsumedLw();
        final int displayId = displayContent.getDisplayId();
        final int displayId = displayContent.getDisplayId();


        if (isDragResizeChanged) {
        if (isDragResizeChanged) {