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
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBarView.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBarView.java
index e8b28f2..b181212 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBarView.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBarView.java
@@ -62,6 +62,7 @@
};
private DarkReceiver mBattery;
private int mLastOrientation;
+ @Nullable
private View mCutoutSpace;
@Nullable
private DisplayCutout mDisplayCutout;
@@ -284,6 +285,11 @@
}
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);