From 473c1f6ccb2d22e062fe7b3b9bfd63ef9fc19337 Mon Sep 17 00:00:00 2001 From: shawnlin Date: Wed, 9 Sep 2020 14:47:25 +0800 Subject: [PATCH] Add a system property to disable screen decorations Provide a way for factory to disable ScreenDecorations to run the Display tests Bug: 167160540 Test: manual 1. adb shell setprop debug.disable_screen_decorations true 2. adb shell pidof com.android.systemui |xargs -i adb shell kill -9 {} 3. adb shell dumpsys SurfaceFlinger and check if there is no screendecoration layers. Change-Id: I13427b32e7dff22fdef216a6b8a22a9f9926357f --- .../src/com/android/systemui/ScreenDecorations.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/packages/SystemUI/src/com/android/systemui/ScreenDecorations.java b/packages/SystemUI/src/com/android/systemui/ScreenDecorations.java index f663d1a0d77c5..1ebe64860a980 100644 --- a/packages/SystemUI/src/com/android/systemui/ScreenDecorations.java +++ b/packages/SystemUI/src/com/android/systemui/ScreenDecorations.java @@ -105,6 +105,9 @@ public class ScreenDecorations extends SystemUI implements Tunable { public static final String SIZE = "sysui_rounded_size"; public static final String PADDING = "sysui_rounded_content_padding"; + // Provide a way for factory to disable ScreenDecorations to run the Display tests. + private static final boolean DEBUG_DISABLE_SCREEN_DECORATIONS = + SystemProperties.getBoolean("debug.disable_screen_decorations", false); private static final boolean DEBUG_SCREENSHOT_ROUNDED_CORNERS = SystemProperties.getBoolean("debug.screenshot_rounded_corners", false); private static final boolean VERBOSE = false; @@ -204,6 +207,10 @@ public class ScreenDecorations extends SystemUI implements Tunable { @Override public void start() { + if (DEBUG_DISABLE_SCREEN_DECORATIONS) { + Log.i(TAG, "ScreenDecorations is disabled"); + return; + } mHandler = startHandlerThread(); mHandler.post(this::startOnScreenDecorationsThread); }