From 0fca17c2a6a83d2d7300baa5ae52f3f05ee16384 Mon Sep 17 00:00:00 2001 From: Jorim Jaggi Date: Mon, 18 Jun 2018 14:24:11 +0200 Subject: [PATCH] DO NOT MERGE Fix crash in case of no overlays Fixes: 110330180 Test: Rotate a device without overlays/cutout Change-Id: Ib0701e26893489fcee0de6aaec26901aef0b8348 --- .../SystemUI/src/com/android/systemui/ScreenDecorations.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/SystemUI/src/com/android/systemui/ScreenDecorations.java b/packages/SystemUI/src/com/android/systemui/ScreenDecorations.java index 6a63b043331e0..194679cc626eb 100644 --- a/packages/SystemUI/src/com/android/systemui/ScreenDecorations.java +++ b/packages/SystemUI/src/com/android/systemui/ScreenDecorations.java @@ -126,7 +126,8 @@ public class ScreenDecorations extends SystemUI implements Tunable { @Override public void onDisplayChanged(int displayId) { - if (mRotation != RotationUtils.getExactRotation(mContext)) { + if (mOverlay != null && mBottomOverlay != null + && mRotation != RotationUtils.getExactRotation(mContext)) { // We cannot immediately update the orientation. Otherwise // WindowManager is still deferring layout until it has finished dispatching // the config changes, which may cause divergence between what we draw