DO NOT MERGE Fix crash in case of no overlays

Fixes: 110330180
Test: Rotate a device without overlays/cutout
Change-Id: Ib0701e26893489fcee0de6aaec26901aef0b8348
This commit is contained in:
Jorim Jaggi
2018-06-18 14:24:11 +02:00
parent 42fb737d13
commit 0fca17c2a6

View File

@@ -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