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
This commit is contained in:
Evan Laird
2021-05-25 16:37:44 -04:00
parent 5610e6c27b
commit a534118aa1

View File

@@ -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<Rect> 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.