From 46b55fe40fca231bcb0b5b04b0c01b34e54936d7 Mon Sep 17 00:00:00 2001 From: Lucas Dupin Date: Wed, 15 Apr 2020 12:43:28 -0700 Subject: Fix crash when changing display cutout Test: manually change cutout Fixes: 153879862 Change-Id: I7da2f0c010569667450efec255c54602c64f797c --- packages/SystemUI/src/com/android/systemui/ScreenDecorations.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/packages/SystemUI/src/com/android/systemui/ScreenDecorations.java b/packages/SystemUI/src/com/android/systemui/ScreenDecorations.java index 922fb69b3fdc..7861211e802d 100644 --- a/packages/SystemUI/src/com/android/systemui/ScreenDecorations.java +++ b/packages/SystemUI/src/com/android/systemui/ScreenDecorations.java @@ -948,7 +948,12 @@ public class ScreenDecorations extends SystemUI implements Tunable { int dw = flipped ? lh : lw; int dh = flipped ? lw : lh; - mBoundingPath.set(DisplayCutout.pathFromResources(getResources(), dw, dh)); + Path path = DisplayCutout.pathFromResources(getResources(), dw, dh); + if (path != null) { + mBoundingPath.set(path); + } else { + mBoundingPath.reset(); + } Matrix m = new Matrix(); transformPhysicalToLogicalCoordinates(mInfo.rotation, dw, dh, m); mBoundingPath.transform(m); -- cgit v1.2.3-59-g8ed1b