From 027f63ccbc5fd7132dcca49653607090d22be1b1 Mon Sep 17 00:00:00 2001 From: Michal Brzezinski Date: Fri, 21 May 2021 13:12:50 +0100 Subject: [PATCH] Fixing notification scrim shifted in landscape orientation With cutout present notification scrim needs to provide relative location as it's already shifted in NotificationShadeWindowView. This doesn't fix the problem entirely, but it's a first step. Bug: 188432897 Test: manual Change-Id: I9eda835cf804e35dac8a81d9be7b3aa0e2e28e11 --- .../statusbar/phone/NotificationPanelViewController.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelViewController.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelViewController.java index 9d8a9bfafe49c..ffd4fc66fcf9b 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelViewController.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelViewController.java @@ -372,6 +372,7 @@ public class NotificationPanelViewController extends PanelViewController { private float mDownX; private float mDownY; private int mDisplayCutoutTopInset = 0; // in pixels + private int mDisplayCutoutLeftInset = 0; // in pixels private int mSplitShadeNotificationsTopPadding; private final KeyguardClockPositionAlgorithm @@ -2175,8 +2176,8 @@ public class NotificationPanelViewController extends PanelViewController { : notificationTop); } bottom = getView().getBottom(); - left = getView().getLeft(); - right = getView().getRight(); + left = getView().getLeft() - mDisplayCutoutLeftInset; + right = getView().getRight() - mDisplayCutoutLeftInset; } else if (qsPanelBottomY > 0) { // so bounds are empty on lockscreen top = Math.min(qsPanelBottomY, mSplitShadeNotificationsTopPadding); bottom = mNotificationStackScrollLayoutController.getHeight(); @@ -4415,6 +4416,7 @@ public class NotificationPanelViewController extends PanelViewController { public WindowInsets onApplyWindowInsets(View v, WindowInsets insets) { final DisplayCutout displayCutout = v.getRootWindowInsets().getDisplayCutout(); mDisplayCutoutTopInset = displayCutout != null ? displayCutout.getSafeInsetTop() : 0; + mDisplayCutoutLeftInset = displayCutout != null ? displayCutout.getSafeInsetLeft() : 0; mNavigationBarBottomHeight = insets.getStableInsetBottom(); updateMaxHeadsUpTranslation();