Merge "Make SystemUI config extendable" into rvc-dev am: d5b5453d18
Change-Id: I34cdbd6ee36ed11b36191c29831ef470c8d1c998
This commit is contained in:
@@ -92,35 +92,28 @@
|
|||||||
<item>com.android.vending</item>
|
<item>com.android.vending</item>
|
||||||
</string-array>
|
</string-array>
|
||||||
|
|
||||||
<!-- SystemUI Services: The classes of the stuff to start. -->
|
<!-- The list of components to exclude from config_systemUIServiceComponents. -->
|
||||||
<string-array name="config_systemUIServiceComponents" translatable="false">
|
<string-array name="config_systemUIServiceComponentsExclude" translatable="false">
|
||||||
<item>com.android.systemui.util.NotificationChannels</item>
|
<item>com.android.systemui.recents.Recents</item>
|
||||||
<item>com.android.systemui.keyguard.KeyguardViewMediator</item>
|
<item>com.android.systemui.volume.VolumeUI</item>
|
||||||
<!-- <item>com.android.systemui.recents.Recents</item>-->
|
<item>com.android.systemui.stackdivider.Divider</item>
|
||||||
<!-- <item>com.android.systemui.volume.VolumeUI</item>-->
|
<item>com.android.systemui.statusbar.phone.StatusBar</item>
|
||||||
<!-- <item>com.android.systemui.stackdivider.Divider</item>-->
|
<item>com.android.systemui.keyboard.KeyboardUI</item>
|
||||||
<!-- <item>com.android.systemui.statusbar.phone.StatusBar</item>-->
|
<item>com.android.systemui.pip.PipUI</item>
|
||||||
<item>com.android.systemui.usb.StorageNotification</item>
|
<item>com.android.systemui.shortcut.ShortcutKeyDispatcher</item>
|
||||||
<item>com.android.systemui.power.PowerUI</item>
|
<item>com.android.systemui.LatencyTester</item>
|
||||||
<item>com.android.systemui.media.RingtonePlayer</item>
|
<item>com.android.systemui.globalactions.GlobalActionsComponent</item>
|
||||||
<!-- <item>com.android.systemui.keyboard.KeyboardUI</item>-->
|
<item>com.android.systemui.SliceBroadcastRelayHandler</item>
|
||||||
<!-- <item>com.android.systemui.pip.PipUI</item>-->
|
<item>com.android.systemui.statusbar.notification.InstantAppNotifier</item>
|
||||||
<!-- <item>com.android.systemui.shortcut.ShortcutKeyDispatcher</item>-->
|
<item>com.android.systemui.accessibility.WindowMagnification</item>
|
||||||
<item>@string/config_systemUIVendorServiceComponent</item>
|
<item>com.android.systemui.accessibility.SystemActions</item>
|
||||||
<item>com.android.systemui.util.leak.GarbageMonitor$Service</item>
|
</string-array>
|
||||||
<!-- <item>com.android.systemui.LatencyTester</item>-->
|
|
||||||
<!-- <item>com.android.systemui.globalactions.GlobalActionsComponent</item>-->
|
<!-- The list of components to append to config_systemUIServiceComponents. -->
|
||||||
<item>com.android.systemui.ScreenDecorations</item>
|
<string-array name="config_systemUIServiceComponentsInclude" translatable="false">
|
||||||
<item>com.android.systemui.biometrics.AuthController</item>
|
|
||||||
<!-- <item>com.android.systemui.SliceBroadcastRelayHandler</item>-->
|
|
||||||
<item>com.android.systemui.SizeCompatModeActivityController</item>
|
|
||||||
<!-- <item>com.android.systemui.statusbar.notification.InstantAppNotifier</item>-->
|
|
||||||
<item>com.android.systemui.theme.ThemeOverlayController</item>
|
|
||||||
<item>com.android.systemui.toast.ToastUI</item>
|
|
||||||
<item>com.android.systemui.car.navigationbar.CarNavigationBar</item>
|
<item>com.android.systemui.car.navigationbar.CarNavigationBar</item>
|
||||||
<item>com.android.systemui.car.voicerecognition.ConnectedDeviceVoiceRecognitionNotifier</item>
|
<item>com.android.systemui.car.voicerecognition.ConnectedDeviceVoiceRecognitionNotifier</item>
|
||||||
<item>com.android.systemui.car.window.SystemUIOverlayWindowManager</item>
|
<item>com.android.systemui.car.window.SystemUIOverlayWindowManager</item>
|
||||||
<item>com.android.systemui.car.volume.VolumeUI</item>
|
<item>com.android.systemui.car.volume.VolumeUI</item>
|
||||||
<item>com.android.systemui.car.sideloaded.SideLoadedAppController</item>
|
|
||||||
</string-array>
|
</string-array>
|
||||||
</resources>
|
</resources>
|
||||||
|
|||||||
@@ -17,9 +17,13 @@
|
|||||||
package com.android.systemui;
|
package com.android.systemui;
|
||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
|
import android.content.res.Resources;
|
||||||
|
|
||||||
import com.android.systemui.dagger.SystemUIRootComponent;
|
import com.android.systemui.dagger.SystemUIRootComponent;
|
||||||
|
|
||||||
|
import java.util.HashSet;
|
||||||
|
import java.util.Set;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class factory to provide car specific SystemUI components.
|
* Class factory to provide car specific SystemUI components.
|
||||||
*/
|
*/
|
||||||
@@ -31,4 +35,26 @@ public class CarSystemUIFactory extends SystemUIFactory {
|
|||||||
.contextHolder(new ContextHolder(context))
|
.contextHolder(new ContextHolder(context))
|
||||||
.build();
|
.build();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String[] getSystemUIServiceComponents(Resources resources) {
|
||||||
|
Set<String> names = new HashSet<>();
|
||||||
|
|
||||||
|
for (String s : super.getSystemUIServiceComponents(resources)) {
|
||||||
|
names.add(s);
|
||||||
|
}
|
||||||
|
|
||||||
|
for (String s : resources.getStringArray(R.array.config_systemUIServiceComponentsExclude)) {
|
||||||
|
names.remove(s);
|
||||||
|
}
|
||||||
|
|
||||||
|
for (String s : resources.getStringArray(R.array.config_systemUIServiceComponentsInclude)) {
|
||||||
|
names.add(s);
|
||||||
|
}
|
||||||
|
|
||||||
|
String[] finalNames = new String[names.size()];
|
||||||
|
names.toArray(finalNames);
|
||||||
|
|
||||||
|
return finalNames;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -139,7 +139,7 @@ public class SystemUIApplication extends Application implements
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
public void startServicesIfNeeded() {
|
public void startServicesIfNeeded() {
|
||||||
String[] names = getResources().getStringArray(R.array.config_systemUIServiceComponents);
|
String[] names = SystemUIFactory.getInstance().getSystemUIServiceComponents(getResources());
|
||||||
startServicesIfNeeded(/* metricsPrefix= */ "StartServices", names);
|
startServicesIfNeeded(/* metricsPrefix= */ "StartServices", names);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -150,8 +150,8 @@ public class SystemUIApplication extends Application implements
|
|||||||
* <p>This method must only be called from the main thread.</p>
|
* <p>This method must only be called from the main thread.</p>
|
||||||
*/
|
*/
|
||||||
void startSecondaryUserServicesIfNeeded() {
|
void startSecondaryUserServicesIfNeeded() {
|
||||||
String[] names =
|
String[] names = SystemUIFactory.getInstance().getSystemUIServiceComponentsPerUser(
|
||||||
getResources().getStringArray(R.array.config_systemUIServiceComponentsPerUser);
|
getResources());
|
||||||
startServicesIfNeeded(/* metricsPrefix= */ "StartSecondaryServices", names);
|
startServicesIfNeeded(/* metricsPrefix= */ "StartSecondaryServices", names);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ package com.android.systemui;
|
|||||||
|
|
||||||
import android.annotation.NonNull;
|
import android.annotation.NonNull;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
|
import android.content.res.Resources;
|
||||||
import android.os.Handler;
|
import android.os.Handler;
|
||||||
import android.os.Looper;
|
import android.os.Looper;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
@@ -120,6 +121,16 @@ public class SystemUIFactory {
|
|||||||
return mRootComponent;
|
return mRootComponent;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** Returns the list of system UI components that should be started. */
|
||||||
|
public String[] getSystemUIServiceComponents(Resources resources) {
|
||||||
|
return resources.getStringArray(R.array.config_systemUIServiceComponents);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Returns the list of system UI components that should be started per user. */
|
||||||
|
public String[] getSystemUIServiceComponentsPerUser(Resources resources) {
|
||||||
|
return resources.getStringArray(R.array.config_systemUIServiceComponentsPerUser);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates an instance of ScreenshotNotificationSmartActionsProvider.
|
* Creates an instance of ScreenshotNotificationSmartActionsProvider.
|
||||||
* This method is overridden in vendor specific implementation of Sys UI.
|
* This method is overridden in vendor specific implementation of Sys UI.
|
||||||
|
|||||||
Reference in New Issue
Block a user