summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2023-07-07 04:50:13 +0000
committerAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2023-07-07 04:50:13 +0000
commit5fcd3e9bd4eb159a1698b5f279ce34eb7c624dec (patch)
treef0725095909c7fce6fff1704334c27704354e843
parent73248a3070367bad0665eb1cbc8426dd4136bf1f (diff)
parent9ac9dbede4e59110c1bfa64cf65cccf1b9ee1a8b (diff)
downloadSystemUIGo-5fcd3e9bd4eb159a1698b5f279ce34eb7c624dec.tar.gz
Change-Id: Ib0de9105c3586cb28a55004de6bc61e1c473bca7
-rw-r--r--Android.bp29
-rw-r--r--AndroidManifest.xml4
-rw-r--r--OWNERS2
-rw-r--r--proguard.flags5
-rw-r--r--res/values/config.xml10
-rw-r--r--src/com/android/systemui/go/SystemUIGoAppComponentFactory.java36
-rw-r--r--src/com/android/systemui/go/SystemUIGoComponent.java10
-rw-r--r--src/com/android/systemui/go/SystemUIGoCoreStartableModule.java7
-rw-r--r--src/com/android/systemui/go/SystemUIGoInitializer.java (renamed from src/com/android/systemui/go/SystemUIGoFactory.java)16
-rw-r--r--src/com/android/systemui/go/SystemUIGoModule.java66
10 files changed, 98 insertions, 87 deletions
diff --git a/Android.bp b/Android.bp
index 7874cbb..f48b643 100644
--- a/Android.bp
+++ b/Android.bp
@@ -18,11 +18,6 @@ package {
default_applicable_licenses: ["Android-Apache-2.0"],
}
-soong_config_module_type_import {
- from: "frameworks/base/packages/SystemUI/Android.bp",
- module_types: ["systemui_optimized_java_defaults"],
-}
-
android_library {
name: "SystemUIGo-core",
srcs: [
@@ -40,30 +35,11 @@ android_library {
plugins: ["dagger2-compiler"],
}
-systemui_optimized_java_defaults {
- name: "SystemUIGo_app_defaults",
- soong_config_variables: {
- SYSTEMUI_OPTIMIZE_JAVA: {
- optimize: {
- enabled: true,
- optimize: true,
- shrink: true,
- proguard_flags_files: ["proguard.flags"],
- },
- conditions_default: {
- optimize: {
- proguard_flags_files: ["proguard.flags"],
- },
- },
- },
- },
-}
-
android_app {
name: "SystemUIGo",
defaults: [
"platform_app_defaults",
- "SystemUIGo_app_defaults",
+ "SystemUI_optimized_defaults",
],
static_libs: [
"SystemUIGo-core"
@@ -81,6 +57,9 @@ android_app {
kotlincflags: ["-Xjvm-default=enable"],
dxflags: ["--multi-dex"],
+ optimize: {
+ proguard_flags_files: ["proguard.flags"],
+ },
required: [
"privapp_whitelist_com.android.systemui",
],
diff --git a/AndroidManifest.xml b/AndroidManifest.xml
index a7b17fd..34642dd 100644
--- a/AndroidManifest.xml
+++ b/AndroidManifest.xml
@@ -20,4 +20,8 @@
package="com.android.systemui"
android:sharedUserId="android.uid.systemui"
coreApp="true">
+ <application
+ tools:replace="android:appComponentFactory"
+ android:appComponentFactory="com.android.systemui.go.SystemUIGoAppComponentFactory">
+ </application>
</manifest>
diff --git a/OWNERS b/OWNERS
index 99088dd..2cb7cb2 100644
--- a/OWNERS
+++ b/OWNERS
@@ -1,2 +1,2 @@
-peskal@google.com
+zzhen@google.com
rajekumar@google.com
diff --git a/proguard.flags b/proguard.flags
index 9b0d998..8cb818b 100644
--- a/proguard.flags
+++ b/proguard.flags
@@ -1,4 +1 @@
--keep class com.android.systemui.go.SystemUIGoFactory
--keep,allowoptimization,allowaccessmodification class com.android.systemui.go.DaggerSystemUIGoGlobalRootComponent$SystemUIGoComponentImpl { !synthetic *; }
-
--include ../../../frameworks/base/packages/SystemUI/proguard.flags \ No newline at end of file
+-include ../../../frameworks/base/packages/SystemUI/proguard_common.flags \ No newline at end of file
diff --git a/res/values/config.xml b/res/values/config.xml
index a9d3ffe..4e5e4e2 100644
--- a/res/values/config.xml
+++ b/res/values/config.xml
@@ -26,8 +26,12 @@
<!-- The minimum number of tiles to display in QuickSettings -->
<integer name="quick_settings_min_num_tiles">3</integer>
- <string name="config_systemUIFactoryComponent" translatable="false">
- com.android.systemui.go.SystemUIGoFactory
- </string>
+ <!-- Whether to enable dimming navigation buttons when wallpaper is not visible, should be
+ enabled for OLED devices to reduce/prevent burn in on the navigation bar (because of the
+ black background and static button placements) and disabled for all other devices to
+ prevent wasting cpu cycles on the dimming animation -->
+ <bool name="config_navigation_bar_enable_auto_dim_no_visible_wallpaper">false</bool>
+ <!-- Determines whether the shell features all run on another thread. -->
+ <bool name="config_enableShellMainThread">true</bool>
</resources>
diff --git a/src/com/android/systemui/go/SystemUIGoAppComponentFactory.java b/src/com/android/systemui/go/SystemUIGoAppComponentFactory.java
new file mode 100644
index 0000000..3c9d674
--- /dev/null
+++ b/src/com/android/systemui/go/SystemUIGoAppComponentFactory.java
@@ -0,0 +1,36 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.systemui.go;
+
+import android.content.Context;
+
+import com.android.systemui.SystemUIAppComponentFactoryBase;
+import com.android.systemui.SystemUIInitializer;
+
+/**
+ * Starts up SystemUI using {@link SystemUIGoInitializer}.
+ *
+ * The {@link SystemUIAppComponentFactoryBase} is required for proper SystemUI functionality.
+ *
+ * @see SystemUIAppComponentFactoryBase
+ */
+public class SystemUIGoAppComponentFactory extends SystemUIAppComponentFactoryBase {
+ @Override
+ protected SystemUIInitializer createSystemUIInitializer(Context context) {
+ return new SystemUIGoInitializer(context);
+ }
+}
diff --git a/src/com/android/systemui/go/SystemUIGoComponent.java b/src/com/android/systemui/go/SystemUIGoComponent.java
index 2e5347f..78b25f7 100644
--- a/src/com/android/systemui/go/SystemUIGoComponent.java
+++ b/src/com/android/systemui/go/SystemUIGoComponent.java
@@ -24,8 +24,11 @@ import com.android.systemui.dagger.SysUIComponent;
import com.android.systemui.dagger.SysUISingleton;
import com.android.systemui.dagger.SystemUIModule;
import com.android.systemui.keyguard.dagger.KeyguardModule;
+import com.android.systemui.keyguard.CustomizationProvider;
import com.android.systemui.recents.RecentsModule;
import com.android.systemui.statusbar.dagger.CentralSurfacesModule;
+import com.android.systemui.statusbar.NotificationInsetsModule;
+import com.android.systemui.statusbar.QsFrameTranslateModule;
import dagger.Subcomponent;
@@ -43,6 +46,8 @@ import dagger.Subcomponent;
KeyguardModule.class,
RecentsModule.class,
CentralSurfacesModule.class,
+ NotificationInsetsModule.class,
+ QsFrameTranslateModule.class,
SystemUIGoModule.class})
public interface SystemUIGoComponent extends SysUIComponent {
@@ -53,4 +58,9 @@ public interface SystemUIGoComponent extends SysUIComponent {
interface Builder extends SysUIComponent.Builder {
SystemUIGoComponent build();
}
+
+ /**
+ * Member injection into the supplied argument.
+ */
+ void inject(CustomizationProvider customizationProvider);
}
diff --git a/src/com/android/systemui/go/SystemUIGoCoreStartableModule.java b/src/com/android/systemui/go/SystemUIGoCoreStartableModule.java
index 6e31199..a7f4a9c 100644
--- a/src/com/android/systemui/go/SystemUIGoCoreStartableModule.java
+++ b/src/com/android/systemui/go/SystemUIGoCoreStartableModule.java
@@ -39,7 +39,6 @@ import com.android.systemui.theme.ThemeOverlayController;
import com.android.systemui.toast.ToastUI;
import com.android.systemui.usb.StorageNotification;
import com.android.systemui.util.NotificationChannels;
-import com.android.systemui.util.leak.GarbageMonitor;
import com.android.systemui.volume.VolumeUI;
import com.android.systemui.wmshell.WMShell;
@@ -66,12 +65,6 @@ abstract class SystemUIGoCoreStartableModule {
@ClassKey(ClipboardListener.class)
abstract CoreStartable bindClipboardListener(ClipboardListener clipboardListener);
- /** Inject into GarbageMonitor.Service. */
- @Binds
- @IntoMap
- @ClassKey(GarbageMonitor.class)
- abstract CoreStartable bindGarbageMonitorService(GarbageMonitor.Service garbageMonitorService);
-
/** Inject into GlobalActionsComponent. */
@Binds
@IntoMap
diff --git a/src/com/android/systemui/go/SystemUIGoFactory.java b/src/com/android/systemui/go/SystemUIGoInitializer.java
index 30a5b89..60cda5b 100644
--- a/src/com/android/systemui/go/SystemUIGoFactory.java
+++ b/src/com/android/systemui/go/SystemUIGoInitializer.java
@@ -18,19 +18,21 @@ package com.android.systemui.go;
import android.content.Context;
-import com.android.systemui.SystemUIFactory;
+import com.android.systemui.SystemUIInitializer;
import com.android.systemui.dagger.GlobalRootComponent;
import com.android.systemui.go.DaggerSystemUIGoGlobalRootComponent;
/**
- * Go variant {@link SystemUIFactory}, that substitutes default {@link GlobalRootComponent} for
+ * Go variant {@link SystemUIInitializer}, that substitutes default {@link GlobalRootComponent} for
* {@link SystemUIGoGlobalRootComponent}
*/
-final public class SystemUIGoFactory extends SystemUIFactory {
+final public class SystemUIGoInitializer extends SystemUIInitializer {
+ public SystemUIGoInitializer(Context context) {
+ super(context);
+ }
+
@Override
- protected GlobalRootComponent buildGlobalRootComponent(Context context) {
- return DaggerSystemUIGoGlobalRootComponent.builder()
- .context(context)
- .build();
+ protected GlobalRootComponent.Builder getGlobalRootComponentBuilder() {
+ return DaggerSystemUIGoGlobalRootComponent.builder();
}
}
diff --git a/src/com/android/systemui/go/SystemUIGoModule.java b/src/com/android/systemui/go/SystemUIGoModule.java
index 389a3de..5ca4db2 100644
--- a/src/com/android/systemui/go/SystemUIGoModule.java
+++ b/src/com/android/systemui/go/SystemUIGoModule.java
@@ -22,46 +22,45 @@ import static com.android.systemui.Dependency.LEAK_REPORT_EMAIL_NAME;
import android.content.Context;
import android.hardware.SensorPrivacyManager;
import android.os.Handler;
-import android.os.PowerManager;
+import com.android.internal.logging.UiEventLogger;
import com.android.keyguard.KeyguardViewController;
-import com.android.systemui.broadcast.BroadcastDispatcher;
import com.android.systemui.dagger.GlobalRootComponent;
import com.android.systemui.dagger.ReferenceSystemUIModule;
import com.android.systemui.dagger.SysUISingleton;
-import com.android.systemui.dagger.qualifiers.Background;
import com.android.systemui.dagger.qualifiers.Main;
-import com.android.systemui.demomode.DemoModeController;
import com.android.systemui.dock.DockManager;
import com.android.systemui.dock.DockManagerImpl;
import com.android.systemui.doze.DozeHost;
import com.android.systemui.media.dagger.MediaModule;
+import com.android.systemui.navigationbar.gestural.GestureModule;
import com.android.systemui.plugins.qs.QSFactory;
import com.android.systemui.plugins.statusbar.StatusBarStateController;
-import com.android.systemui.power.EnhancedEstimates;
import com.android.systemui.power.dagger.PowerModule;
import com.android.systemui.qs.dagger.QSModule;
import com.android.systemui.qs.tileimpl.QSFactoryImpl;
import com.android.systemui.recents.Recents;
import com.android.systemui.recents.RecentsImplementation;
+import com.android.systemui.screenshot.ReferenceScreenshotModule;
+import com.android.systemui.settings.dagger.MultiUserUtilsModule;
+import com.android.systemui.shade.NotificationShadeWindowControllerImpl;
+import com.android.systemui.shade.ShadeController;
+import com.android.systemui.shade.ShadeControllerImpl;
+import com.android.systemui.shade.ShadeExpansionStateManager;
import com.android.systemui.statusbar.CommandQueue;
import com.android.systemui.statusbar.NotificationLockscreenUserManager;
import com.android.systemui.statusbar.NotificationLockscreenUserManagerImpl;
import com.android.systemui.statusbar.NotificationShadeWindowController;
import com.android.systemui.statusbar.dagger.StartCentralSurfacesModule;
-import com.android.systemui.statusbar.notification.NotificationEntryManager;
+import com.android.systemui.statusbar.events.StatusBarEventsModule;
import com.android.systemui.statusbar.notification.collection.provider.VisualStabilityProvider;
import com.android.systemui.statusbar.notification.collection.render.GroupMembershipManager;
import com.android.systemui.statusbar.phone.DozeServiceHost;
import com.android.systemui.statusbar.phone.HeadsUpManagerPhone;
import com.android.systemui.statusbar.phone.KeyguardBypassController;
-import com.android.systemui.statusbar.phone.KeyguardEnvironmentImpl;
-import com.android.systemui.statusbar.phone.NotificationShadeWindowControllerImpl;
-import com.android.systemui.statusbar.phone.ShadeController;
-import com.android.systemui.statusbar.phone.ShadeControllerImpl;
import com.android.systemui.statusbar.phone.StatusBarKeyguardViewManager;
-import com.android.systemui.statusbar.policy.BatteryController;
-import com.android.systemui.statusbar.policy.BatteryControllerImpl;
+import com.android.systemui.statusbar.policy.AccessibilityManagerWrapper;
+import com.android.systemui.statusbar.policy.AospPolicyModule;
import com.android.systemui.statusbar.policy.ConfigurationController;
import com.android.systemui.statusbar.policy.DeviceProvisionedController;
import com.android.systemui.statusbar.policy.DeviceProvisionedControllerImpl;
@@ -84,10 +83,15 @@ import dagger.Provides;
* Android Go. This is forked from {@link ReferenceSystemUIModule}
*/
@Module(includes = {
+ AospPolicyModule.class,
+ GestureModule.class,
MediaModule.class,
+ MultiUserUtilsModule.class,
PowerModule.class,
QSModule.class,
+ ReferenceScreenshotModule.class,
StartCentralSurfacesModule.class,
+ StatusBarEventsModule.class,
VolumeModule.class
})
public abstract class SystemUIGoModule {
@@ -109,28 +113,6 @@ public abstract class SystemUIGoModule {
@Provides
@SysUISingleton
- static BatteryController provideBatteryController(
- Context context,
- EnhancedEstimates enhancedEstimates,
- PowerManager powerManager,
- BroadcastDispatcher broadcastDispatcher,
- DemoModeController demoModeController,
- @Main Handler mainHandler,
- @Background Handler bgHandler) {
- BatteryController bC = new BatteryControllerImpl(
- context,
- enhancedEstimates,
- powerManager,
- broadcastDispatcher,
- demoModeController,
- mainHandler,
- bgHandler);
- bC.init();
- return bC;
- }
-
- @Provides
- @SysUISingleton
static SensorPrivacyController provideSensorPrivacyController(
SensorPrivacyManager sensorPrivacyManager) {
SensorPrivacyController spC = new SensorPrivacyControllerImpl(sensorPrivacyManager);
@@ -156,10 +138,6 @@ public abstract class SystemUIGoModule {
abstract DockManager bindDockManager(DockManagerImpl dockManager);
@Binds
- abstract NotificationEntryManager.KeyguardEnvironment bindKeyguardEnvironment(
- KeyguardEnvironmentImpl keyguardEnvironment);
-
- @Binds
abstract ShadeController provideShadeController(ShadeControllerImpl shadeController);
@SysUISingleton
@@ -178,7 +156,11 @@ public abstract class SystemUIGoModule {
KeyguardBypassController bypassController,
GroupMembershipManager groupManager,
VisualStabilityProvider visualStabilityProvider,
- ConfigurationController configurationController) {
+ ConfigurationController configurationController,
+ @Main Handler handler,
+ AccessibilityManagerWrapper accessibilityManagerWrapper,
+ UiEventLogger uiEventLogger,
+ ShadeExpansionStateManager shadeExpansionStateManager) {
return new HeadsUpManagerPhone(
context,
headsUpManagerLogger,
@@ -186,7 +168,11 @@ public abstract class SystemUIGoModule {
bypassController,
groupManager,
visualStabilityProvider,
- configurationController
+ configurationController,
+ handler,
+ accessibilityManagerWrapper,
+ uiEventLogger,
+ shadeExpansionStateManager
);
}