summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Caitlin Shkuratov <caitlinshk@google.com> 2024-10-29 16:03:42 +0000
committer Caitlin Shkuratov <caitlinshk@google.com> 2024-10-29 16:12:05 +0000
commit68bd94ee92ae5ed902efc61f99a9fe708ab1551c (patch)
treee021571046ebcb2ead07ceac7f73216bc32e226e
parentdc280f166a0c99d3ae00b9e7e7de0e973312696f (diff)
[CS] Create ReferenceNotificationsModule.
Almost all SysUI variants include both NotificationsModule and NotificationRowModule. This CL combines them into a module called ReferenceNotificationsModule and uses that module everywhere. It also removes the notifications module from CentralSurfacesModule, and instead just puts them at the top-level SysUI modules (since notif classes are used by much more than just CentralSurfaces.java). This will help the promoted notifications work, because that work will add additional notification modules that should also be included wherever the current modules are included. Bug: 277764509 Test: SysUI compiles Flag: EXEMPT refactor Change-Id: I19390e8211ab8410eb40824752faf5dd55c08282
-rw-r--r--packages/SystemUI/src/com/android/systemui/dagger/ReferenceSystemUIModule.java2
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/dagger/CentralSurfacesModule.java5
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/notification/dagger/ReferenceNotificationsModule.kt27
3 files changed, 30 insertions, 4 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/dagger/ReferenceSystemUIModule.java b/packages/SystemUI/src/com/android/systemui/dagger/ReferenceSystemUIModule.java
index bf93469f6c70..609b7330b600 100644
--- a/packages/SystemUI/src/com/android/systemui/dagger/ReferenceSystemUIModule.java
+++ b/packages/SystemUI/src/com/android/systemui/dagger/ReferenceSystemUIModule.java
@@ -72,6 +72,7 @@ import com.android.systemui.statusbar.NotificationShadeWindowController;
import com.android.systemui.statusbar.SysuiStatusBarStateController;
import com.android.systemui.statusbar.dagger.CentralSurfacesModule;
import com.android.systemui.statusbar.dagger.StartCentralSurfacesModule;
+import com.android.systemui.statusbar.notification.dagger.ReferenceNotificationsModule;
import com.android.systemui.statusbar.phone.CentralSurfaces;
import com.android.systemui.statusbar.phone.DozeServiceHost;
import com.android.systemui.statusbar.phone.HeadsUpModule;
@@ -145,6 +146,7 @@ import javax.inject.Named;
QSModule.class,
RearDisplayModule.class,
RecentsModule.class,
+ ReferenceNotificationsModule.class,
ReferenceScreenshotModule.class,
RotationLockModule.class,
RotationLockNewModule.class,
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/dagger/CentralSurfacesModule.java b/packages/SystemUI/src/com/android/systemui/statusbar/dagger/CentralSurfacesModule.java
index 72cd63f3ae62..ad22caaf9156 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/dagger/CentralSurfacesModule.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/dagger/CentralSurfacesModule.java
@@ -17,8 +17,6 @@
package com.android.systemui.statusbar.dagger;
import com.android.systemui.dagger.SysUISingleton;
-import com.android.systemui.statusbar.notification.dagger.NotificationsModule;
-import com.android.systemui.statusbar.notification.row.NotificationRowModule;
import com.android.systemui.statusbar.phone.CentralSurfaces;
import com.android.systemui.statusbar.phone.CentralSurfacesImpl;
import com.android.systemui.statusbar.phone.StatusBarNotificationPresenterModule;
@@ -30,8 +28,7 @@ import dagger.Module;
* Dagger Module providing {@link CentralSurfacesImpl}.
*/
@Module(includes = {CentralSurfacesDependenciesModule.class,
- StatusBarNotificationPresenterModule.class,
- NotificationsModule.class, NotificationRowModule.class})
+ StatusBarNotificationPresenterModule.class})
public interface CentralSurfacesModule {
/**
* Provides our instance of CentralSurfaces which is considered optional.
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/dagger/ReferenceNotificationsModule.kt b/packages/SystemUI/src/com/android/systemui/statusbar/notification/dagger/ReferenceNotificationsModule.kt
new file mode 100644
index 000000000000..925d4a588f09
--- /dev/null
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/dagger/ReferenceNotificationsModule.kt
@@ -0,0 +1,27 @@
+/*
+ * Copyright (C) 2024 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.statusbar.notification.dagger
+
+import com.android.systemui.statusbar.notification.row.NotificationRowModule
+import dagger.Module
+
+/**
+ * A module that includes the standard notifications classes that most SysUI variants need. Variants
+ * are free to not include this module and instead write a custom notifications module.
+ */
+@Module(includes = [NotificationsModule::class, NotificationRowModule::class])
+object ReferenceNotificationsModule