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

Commit ce463c85 authored by Adrian Roos's avatar Adrian Roos Committed by android-build-merger
Browse files

Merge "DisplayCutout: make dock divider cutout aware" into pi-dev

am: f5239f00

Change-Id: I7bc25667a3c42ef683b8c656268686fc663c5ce4
parents b0850c9a f5239f00
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -28,6 +28,7 @@ import static android.view.WindowManager.LayoutParams.FLAG_NOT_TOUCH_MODAL;
import static android.view.WindowManager.LayoutParams.FLAG_SLIPPERY;
import static android.view.WindowManager.LayoutParams.FLAG_SPLIT_TOUCH;
import static android.view.WindowManager.LayoutParams.FLAG_WATCH_OUTSIDE_TOUCH;
import static android.view.WindowManager.LayoutParams.LAYOUT_IN_DISPLAY_CUTOUT_MODE_ALWAYS;
import static android.view.WindowManager.LayoutParams.PRIVATE_FLAG_NO_MOVE_ANIMATION;
import static android.view.WindowManager.LayoutParams.TYPE_DOCK_DIVIDER;

@@ -55,6 +56,7 @@ public class DividerWindowManager {
        mLp.token = new Binder();
        mLp.setTitle(WINDOW_TITLE);
        mLp.privateFlags |= PRIVATE_FLAG_NO_MOVE_ANIMATION;
        mLp.layoutInDisplayCutoutMode = LAYOUT_IN_DISPLAY_CUTOUT_MODE_ALWAYS;
        view.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
                | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
                | View.SYSTEM_UI_FLAG_LAYOUT_STABLE);
+10 −4
Original line number Diff line number Diff line
@@ -1032,15 +1032,21 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP
        if (mAttrs.type == TYPE_DOCK_DIVIDER) {
            // For the docked divider, we calculate the stable insets like a full-screen window
            // so it can use it to calculate the snap positions.
            mStableInsets.set(Math.max(mStableFrame.left - mDisplayFrame.left, 0),
                    Math.max(mStableFrame.top - mDisplayFrame.top, 0),
                    Math.max(mDisplayFrame.right - mStableFrame.right, 0),
                    Math.max(mDisplayFrame.bottom - mStableFrame.bottom, 0));
            final WmDisplayCutout c = displayCutout.calculateRelativeTo(mDisplayFrame);
            mTmpRect.set(mDisplayFrame);
            mTmpRect.inset(c.getDisplayCutout().getSafeInsets());
            mTmpRect.intersectUnchecked(mStableFrame);

            mStableInsets.set(Math.max(mTmpRect.left - mDisplayFrame.left, 0),
                    Math.max(mTmpRect.top - mDisplayFrame.top, 0),
                    Math.max(mDisplayFrame.right - mTmpRect.right, 0),
                    Math.max(mDisplayFrame.bottom - mTmpRect.bottom, 0));

            // The divider doesn't care about insets in any case, so set it to empty so we don't
            // trigger a relayout when moving it.
            mContentInsets.setEmpty();
            mVisibleInsets.setEmpty();
            displayCutout = WmDisplayCutout.NO_CUTOUT;
        } else {
            getDisplayContent().getBounds(mTmpRect);
            // Override right and/or bottom insets in case if the frame doesn't fit the screen in