From 425fa2936120b39906764e7d463bb0ab8b954da9 Mon Sep 17 00:00:00 2001 From: Milton Wu Date: Mon, 6 Jun 2022 10:56:36 +0000 Subject: [PATCH] Fix NullPointer when factory debug flag enabled When debug.screenshot_rounded_corners prop is true, some class fields are not initialized through start(). And it causes a NullPointerException during dumping ScreenDecorations. Bug: 234549460 Test: 1. Enable debug.screenshot_rounded_corners 2. Restart sysui process 3. adb shell dumpsys activity service com.android.systemui Change-Id: If0a31b19fb160de5bb717c1e76af2503d22c10af --- .../SystemUI/src/com/android/systemui/ScreenDecorations.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/SystemUI/src/com/android/systemui/ScreenDecorations.java b/packages/SystemUI/src/com/android/systemui/ScreenDecorations.java index c04463ad6906c..dc1a1e0097433 100644 --- a/packages/SystemUI/src/com/android/systemui/ScreenDecorations.java +++ b/packages/SystemUI/src/com/android/systemui/ScreenDecorations.java @@ -971,6 +971,10 @@ public class ScreenDecorations extends CoreStartable implements Tunable , Dumpab public void dump(@NonNull PrintWriter pw, @NonNull String[] args) { pw.println("ScreenDecorations state:"); pw.println(" DEBUG_DISABLE_SCREEN_DECORATIONS:" + DEBUG_DISABLE_SCREEN_DECORATIONS); + if (DEBUG_DISABLE_SCREEN_DECORATIONS) { + return; + } + pw.println(" mIsPrivacyDotEnabled:" + isPrivacyDotEnabled()); pw.println(" isOnlyPrivacyDotInSwLayer:" + isOnlyPrivacyDotInSwLayer()); pw.println(" mPendingConfigChange:" + mPendingConfigChange);