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

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

Fix crash when PhoneStatusBarView has no cutout

Not all layouts will have cutouts after all, and PhoneStatusBarView
can't expect there to be one for no reason.

Test: manually verified that removing the cutout won't cause issues
Change-Id: Id02b467c7a650c12ab61f294eec576420dccd130
Fixes: 72325926
parent 129f8ae2
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -62,6 +62,7 @@ public class PhoneStatusBarView extends PanelBar {
    };
    private DarkReceiver mBattery;
    private int mLastOrientation;
    @Nullable
    private View mCutoutSpace;
    @Nullable
    private DisplayCutout mDisplayCutout;
@@ -284,6 +285,11 @@ public class PhoneStatusBarView extends PanelBar {
    }

    private void updateCutoutLocation() {
        // Not all layouts have a cutout (e.g., Car)
        if (mCutoutSpace == null) {
            return;
        }

        if (mDisplayCutout == null || mDisplayCutout.isEmpty()
                    || mLastOrientation != ORIENTATION_PORTRAIT) {
            mCutoutSpace.setVisibility(View.GONE);