diff --git a/packages/SystemUI/src/com/android/systemui/ScreenDecorations.java b/packages/SystemUI/src/com/android/systemui/ScreenDecorations.java index c3412f2db78dc..9b16eeca36b48 100644 --- a/packages/SystemUI/src/com/android/systemui/ScreenDecorations.java +++ b/packages/SystemUI/src/com/android/systemui/ScreenDecorations.java @@ -554,7 +554,18 @@ public class ScreenDecorations extends SystemUI implements Tunable { return null; } - return mInfo.displayCutout.getBounds(); + View rootView = getRootView(); + Region cutoutBounds = mInfo.displayCutout.getBounds(); + + // Transform to window's coordinate space + rootView.getLocationOnScreen(mLocation); + cutoutBounds.translate(-mLocation[0], -mLocation[1]); + + // Intersect with window's frame + cutoutBounds.op(rootView.getLeft(), rootView.getTop(), rootView.getRight(), + rootView.getBottom(), Region.Op.INTERSECT); + + return cutoutBounds; } } }