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

Commit a534118a authored by Evan Laird's avatar Evan Laird
Browse files

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
parent 5610e6c2
Loading
Loading
Loading
Loading
+0 −21
Original line number Original line Diff line number Diff line
@@ -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;
import com.android.systemui.statusbar.notification.collection.NotificationEntry.OnSensitivityChangedListener;
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
 * 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 int[] mTmpPosition = new int[2];
    private boolean mFirstLayout = true;
    private boolean mFirstLayout = true;
    private int mMaxWidth;
    private int mMaxWidth;
    private View mRootView;
    private int mSysWinInset;
    private int mSysWinInset;
    private int mCutOutInset;
    private int mCutOutInset;
    private List<Rect> mCutOutBounds;
    private Rect mIconDrawingRect = new Rect();
    private Rect mIconDrawingRect = new Rect();
    private Point mDisplaySize;
    private Point mDisplaySize;
    private Runnable mOnDrawingRectChangedListener;
    private Runnable mOnDrawingRectChangedListener;
@@ -197,19 +194,7 @@ public class HeadsUpStatusBarView extends AlphaOptimizedLinearLayout {
        int targetPadding = mAbsoluteStartPadding + mSysWinInset + mCutOutInset;
        int targetPadding = mAbsoluteStartPadding + mSysWinInset + mCutOutInset;
        boolean isRtl = isLayoutRtl();
        boolean isRtl = isLayoutRtl();
        int start = isRtl ? (mDisplaySize.x - right) : left;
        int start = isRtl ? (mDisplaySize.x - right) : left;

        if (start != targetPadding) {
        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();
            int newPadding = targetPadding - start + getPaddingStart();
            setPaddingRelative(newPadding, 0, mEndMargin, 0);
            setPaddingRelative(newPadding, 0, mEndMargin, 0);
        }
        }
@@ -252,12 +237,6 @@ public class HeadsUpStatusBarView extends AlphaOptimizedLinearLayout {


        getDisplaySize();
        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
        // 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
        // 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.
        // out width so we set mCutOutInset to be 0. For RTL, the condition is the same.