From 8039843c122d9dd013bf5d3b0867e2ed75c5f540 Mon Sep 17 00:00:00 2001 From: Bryce Lee Date: Thu, 22 Jul 2021 22:09:36 -0700 Subject: [PATCH] Add additional SystemUI services config. This changelist adds a new array where SystemUI services can be specified through an overlay. This additional array helps prevent drift in overlays in the main services array. Bug: 194454071 Test: manual Change-Id: I8910122f93bf1ebb6a10b6be9cd71c83dd06e7ab --- packages/SystemUI/res/values/config.xml | 9 ++++++++- .../com/android/systemui/SystemUIApplication.java | 15 +++++++++++++-- .../src/com/android/systemui/SystemUIFactory.java | 7 +++++++ 3 files changed, 28 insertions(+), 3 deletions(-) diff --git a/packages/SystemUI/res/values/config.xml b/packages/SystemUI/res/values/config.xml index 30537df111993..6dc7bc641a732 100644 --- a/packages/SystemUI/res/values/config.xml +++ b/packages/SystemUI/res/values/config.xml @@ -313,7 +313,8 @@ com.android.systemui.SystemUIFactory - + com.android.systemui.util.NotificationChannels com.android.systemui.keyguard.KeyguardViewMediator @@ -340,6 +341,12 @@ com.android.systemui.wmshell.WMShell + + + + -1dp -1dp diff --git a/packages/SystemUI/src/com/android/systemui/SystemUIApplication.java b/packages/SystemUI/src/com/android/systemui/SystemUIApplication.java index 865ca40b1f4cd..4fd2701314665 100644 --- a/packages/SystemUI/src/com/android/systemui/SystemUIApplication.java +++ b/packages/SystemUI/src/com/android/systemui/SystemUIApplication.java @@ -42,6 +42,8 @@ import com.android.systemui.util.NotificationChannels; import java.lang.reflect.Constructor; import java.lang.reflect.InvocationTargetException; +import java.util.ArrayList; +import java.util.Collections; /** * Application class for SystemUI. @@ -159,8 +161,17 @@ public class SystemUIApplication extends Application implements */ public void startServicesIfNeeded() { - String[] names = SystemUIFactory.getInstance().getSystemUIServiceComponents(getResources()); - startServicesIfNeeded(/* metricsPrefix= */ "StartServices", names); + final String[] names = SystemUIFactory.getInstance() + .getSystemUIServiceComponents(getResources()); + final String[] additionalNames = SystemUIFactory.getInstance() + .getAdditionalSystemUIServiceComponents(getResources()); + + final ArrayList serviceComponents = new ArrayList<>(); + Collections.addAll(serviceComponents, names); + Collections.addAll(serviceComponents, additionalNames); + + startServicesIfNeeded(/* metricsPrefix= */ "StartServices", + serviceComponents.toArray(new String[serviceComponents.size()])); } /** diff --git a/packages/SystemUI/src/com/android/systemui/SystemUIFactory.java b/packages/SystemUI/src/com/android/systemui/SystemUIFactory.java index a28223de2bf12..d31301aacbcbd 100644 --- a/packages/SystemUI/src/com/android/systemui/SystemUIFactory.java +++ b/packages/SystemUI/src/com/android/systemui/SystemUIFactory.java @@ -186,6 +186,13 @@ public class SystemUIFactory { return resources.getStringArray(R.array.config_systemUIServiceComponents); } + /** + * Returns the list of additional system UI components that should be started. + */ + public String[] getAdditionalSystemUIServiceComponents(Resources resources) { + return resources.getStringArray(R.array.config_additionalSystemUIServiceComponents); + } + /** * Returns the list of system UI components that should be started per user. */