From a534118aa155c294971326d5d350a6fb94129c6e Mon Sep 17 00:00:00 2001 From: Evan Laird Date: Tue, 25 May 2021 16:37:44 -0400 Subject: [PATCH] Remove corner cutout tracking from HeadsUpStatusBarView It seems that once corner cutout tracking was brought to the entire content view of status_bar, HeadsUpStatusBarView started potentially double counting left-side corner cutout views and no longer needs it There is still an issue here that we don't get a layout pass quick enough if a HUN happens right after a rotation. But this brings us back to an eventually-stable layout Test: manual; trigger a heads up notification after rotation on a device with a display cutout Fixes: 185679234 Change-Id: I2930d95f817c42df68aafd45e143f87bd03f7e71 --- .../statusbar/HeadsUpStatusBarView.java | 21 ------------------- 1 file changed, 21 deletions(-) diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/HeadsUpStatusBarView.java b/packages/SystemUI/src/com/android/systemui/statusbar/HeadsUpStatusBarView.java index b33424c563a38..acfd998ff6e44 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/HeadsUpStatusBarView.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/HeadsUpStatusBarView.java @@ -35,7 +35,6 @@ import com.android.systemui.plugins.DarkIconDispatcher; import com.android.systemui.statusbar.notification.collection.NotificationEntry; import com.android.systemui.statusbar.notification.collection.NotificationEntry.OnSensitivityChangedListener; -import java.util.List; /** * The view in the statusBar that contains part of the heads-up information @@ -55,10 +54,8 @@ public class HeadsUpStatusBarView extends AlphaOptimizedLinearLayout { private int[] mTmpPosition = new int[2]; private boolean mFirstLayout = true; private int mMaxWidth; - private View mRootView; private int mSysWinInset; private int mCutOutInset; - private List mCutOutBounds; private Rect mIconDrawingRect = new Rect(); private Point mDisplaySize; private Runnable mOnDrawingRectChangedListener; @@ -197,19 +194,7 @@ public class HeadsUpStatusBarView extends AlphaOptimizedLinearLayout { int targetPadding = mAbsoluteStartPadding + mSysWinInset + mCutOutInset; boolean isRtl = isLayoutRtl(); int start = isRtl ? (mDisplaySize.x - right) : left; - if (start != targetPadding) { - if (mCutOutBounds != null) { - for (Rect cutOutRect : mCutOutBounds) { - int cutOutStart = (isRtl) - ? (mDisplaySize.x - cutOutRect.right) : cutOutRect.left; - if (start > cutOutStart) { - start -= cutOutRect.width(); - break; - } - } - } - int newPadding = targetPadding - start + getPaddingStart(); setPaddingRelative(newPadding, 0, mEndMargin, 0); } @@ -252,12 +237,6 @@ public class HeadsUpStatusBarView extends AlphaOptimizedLinearLayout { getDisplaySize(); - mCutOutBounds = null; - if (displayCutout != null && displayCutout.getSafeInsetRight() == 0 - && displayCutout.getSafeInsetLeft() == 0) { - mCutOutBounds = displayCutout.getBoundingRects(); - } - // For Double Cut Out mode, the System window navigation bar is at the right // side of the left cut out. In this condition, mSysWinInset include the left cut // out width so we set mCutOutInset to be 0. For RTL, the condition is the same.