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

Commit 028e367a authored by Shawn Lin's avatar Shawn Lin Committed by Automerger Merge Worker
Browse files

Merge "Fix WindowInsetsBehaviorTests failure" into sc-qpr1-dev am: 2da350d9

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

Change-Id: I721dd6ff71ca6a7842acde81246a7b01f11cd429
parents a07f72ca 2da350d9
Loading
Loading
Loading
Loading
+19 −1
Original line number Diff line number Diff line
@@ -377,6 +377,8 @@ public class DisplayPolicy {

    private PointerLocationView mPointerLocationView;

    private int mDisplayCutoutTouchableRegionSize;

    /**
     * The area covered by system windows which belong to another display. Forwarded insets is set
     * in case this is a virtual display, this is displayed on another display that has insets, and
@@ -1109,8 +1111,21 @@ public class DisplayPolicy {
                                rect.bottom = rect.top + getStatusBarHeight(displayFrames);
                            }
                        };
                final TriConsumer<DisplayFrames, WindowState, Rect> gestureFrameProvider =
                        (displayFrames, windowState, rect) -> {
                            rect.bottom = rect.top + getStatusBarHeight(displayFrames);
                            final DisplayCutout cutout =
                                    displayFrames.mInsetsState.getDisplayCutout();
                            if (cutout != null) {
                                final Rect top = cutout.getBoundingRectTop();
                                if (!top.isEmpty()) {
                                    rect.bottom = rect.bottom + mDisplayCutoutTouchableRegionSize;
                                }
                            }
                        };
                mDisplayContent.setInsetProvider(ITYPE_STATUS_BAR, win, frameProvider);
                mDisplayContent.setInsetProvider(ITYPE_TOP_MANDATORY_GESTURES, win, frameProvider);
                mDisplayContent.setInsetProvider(
                        ITYPE_TOP_MANDATORY_GESTURES, win, gestureFrameProvider);
                mDisplayContent.setInsetProvider(ITYPE_TOP_TAPPABLE_ELEMENT, win, frameProvider);
                break;
            case TYPE_NAVIGATION_BAR:
@@ -2091,11 +2106,14 @@ public class DisplayPolicy {
            mStatusBarHeightForRotation[landscapeRotation] =
                    mStatusBarHeightForRotation[seascapeRotation] =
                            res.getDimensionPixelSize(R.dimen.status_bar_height_landscape);
            mDisplayCutoutTouchableRegionSize = res.getDimensionPixelSize(
                    R.dimen.display_cutout_touchable_region_size);
        } else {
            mStatusBarHeightForRotation[portraitRotation] =
                    mStatusBarHeightForRotation[upsideDownRotation] =
                            mStatusBarHeightForRotation[landscapeRotation] =
                                    mStatusBarHeightForRotation[seascapeRotation] = 0;
            mDisplayCutoutTouchableRegionSize = 0;
        }

        // Height of the navigation bar when presented horizontally at bottom