From 173f30edefdc5a025fcefa0b265bb2b9841bae99 Mon Sep 17 00:00:00 2001 From: Bill Lin Date: Tue, 17 Mar 2020 19:06:51 +0800 Subject: [PATCH] Add NPE check in CameraTransitionCallback CameraManager.AvailabilityCallback will notifyCameraInactive() at initial stage, and cause NPE when mCutoutViews is NULL Initialize mCutoutView at early stage Bug: 151706640 Test: manual boot device Test atest SystemUITests Change-Id: I2008342d15bb589f85bb99fcc35ede96ef9678bd --- .../SystemUI/src/com/android/systemui/ScreenDecorations.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/SystemUI/src/com/android/systemui/ScreenDecorations.java b/packages/SystemUI/src/com/android/systemui/ScreenDecorations.java index a8a3caecc7802..5f004a631e465 100644 --- a/packages/SystemUI/src/com/android/systemui/ScreenDecorations.java +++ b/packages/SystemUI/src/com/android/systemui/ScreenDecorations.java @@ -122,7 +122,7 @@ public class ScreenDecorations extends SystemUI implements Tunable { protected int mRoundedDefaultBottom; @VisibleForTesting protected View[] mOverlays; - private DisplayCutoutView[] mCutoutViews; + private DisplayCutoutView[] mCutoutViews = new DisplayCutoutView[BOUNDS_POSITION_LENGTH]; private float mDensity; private WindowManager mWindowManager; private int mRotation;