Heemin Seog | 1a39dea | 2019-10-16 15:58:21 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2019 The Android Open Source Project |
| 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
| 16 | |
| 17 | package com.android.systemui; |
| 18 | |
Dave Mankoff | a7ca157 | 2019-10-23 17:09:17 -0400 | [diff] [blame] | 19 | import static com.android.systemui.Dependency.ALLOW_NOTIFICATION_LONG_PRESS_NAME; |
| 20 | |
| 21 | import android.content.Context; |
| 22 | import android.os.PowerManager; |
| 23 | import android.util.DisplayMetrics; |
| 24 | |
| 25 | import com.android.internal.logging.MetricsLogger; |
| 26 | import com.android.keyguard.KeyguardUpdateMonitor; |
| 27 | import com.android.systemui.appops.AppOpsController; |
| 28 | import com.android.systemui.assist.AssistManager; |
Dave Mankoff | bcaca8a | 2019-10-31 18:04:08 -0400 | [diff] [blame] | 29 | import com.android.systemui.biometrics.AuthController; |
Dave Mankoff | a7ca157 | 2019-10-23 17:09:17 -0400 | [diff] [blame] | 30 | import com.android.systemui.broadcast.BroadcastDispatcher; |
| 31 | import com.android.systemui.bubbles.BubbleController; |
| 32 | import com.android.systemui.colorextraction.SysuiColorExtractor; |
| 33 | import com.android.systemui.doze.DozeLog; |
Dave Mankoff | bcaca8a | 2019-10-31 18:04:08 -0400 | [diff] [blame] | 34 | import com.android.systemui.globalactions.GlobalActionsComponent; |
Dave Mankoff | ae8ec45 | 2019-10-29 15:50:02 -0400 | [diff] [blame] | 35 | import com.android.systemui.keyguard.KeyguardViewMediator; |
Dave Mankoff | a7ca157 | 2019-10-23 17:09:17 -0400 | [diff] [blame] | 36 | import com.android.systemui.keyguard.ScreenLifecycle; |
| 37 | import com.android.systemui.keyguard.WakefulnessLifecycle; |
Heemin Seog | 1a39dea | 2019-10-16 15:58:21 -0700 | [diff] [blame] | 38 | import com.android.systemui.navigationbar.car.CarNavigationBar; |
Dave Mankoff | a7ca157 | 2019-10-23 17:09:17 -0400 | [diff] [blame] | 39 | import com.android.systemui.navigationbar.car.CarNavigationBarController; |
Dave Mankoff | ae8ec45 | 2019-10-29 15:50:02 -0400 | [diff] [blame] | 40 | import com.android.systemui.pip.PipUI; |
Dave Mankoff | a7ca157 | 2019-10-23 17:09:17 -0400 | [diff] [blame] | 41 | import com.android.systemui.plugins.FalsingManager; |
Dave Mankoff | ae8ec45 | 2019-10-29 15:50:02 -0400 | [diff] [blame] | 42 | import com.android.systemui.power.PowerUI; |
| 43 | import com.android.systemui.recents.Recents; |
| 44 | import com.android.systemui.recents.RecentsModule; |
Dave Mankoff | 2e48492 | 2019-10-31 12:25:08 -0400 | [diff] [blame] | 45 | import com.android.systemui.shared.plugins.PluginManager; |
Dave Mankoff | bcaca8a | 2019-10-31 18:04:08 -0400 | [diff] [blame] | 46 | import com.android.systemui.statusbar.CommandQueue; |
Dave Mankoff | a7ca157 | 2019-10-23 17:09:17 -0400 | [diff] [blame] | 47 | import com.android.systemui.statusbar.FeatureFlags; |
| 48 | import com.android.systemui.statusbar.NavigationBarController; |
| 49 | import com.android.systemui.statusbar.NotificationListener; |
| 50 | import com.android.systemui.statusbar.NotificationLockscreenUserManager; |
| 51 | import com.android.systemui.statusbar.NotificationMediaManager; |
| 52 | import com.android.systemui.statusbar.NotificationRemoteInputManager; |
| 53 | import com.android.systemui.statusbar.NotificationViewHierarchyManager; |
| 54 | import com.android.systemui.statusbar.PulseExpansionHandler; |
| 55 | import com.android.systemui.statusbar.SysuiStatusBarStateController; |
| 56 | import com.android.systemui.statusbar.VibratorHelper; |
Dave Mankoff | ae8ec45 | 2019-10-29 15:50:02 -0400 | [diff] [blame] | 57 | import com.android.systemui.statusbar.car.CarStatusBar; |
Dave Mankoff | a7ca157 | 2019-10-23 17:09:17 -0400 | [diff] [blame] | 58 | import com.android.systemui.statusbar.notification.BypassHeadsUpNotifier; |
| 59 | import com.android.systemui.statusbar.notification.DynamicPrivacyController; |
Dave Mankoff | bcaca8a | 2019-10-31 18:04:08 -0400 | [diff] [blame] | 60 | import com.android.systemui.statusbar.notification.InstantAppNotifier; |
Dave Mankoff | a7ca157 | 2019-10-23 17:09:17 -0400 | [diff] [blame] | 61 | import com.android.systemui.statusbar.notification.NewNotifPipeline; |
| 62 | import com.android.systemui.statusbar.notification.NotificationAlertingManager; |
| 63 | import com.android.systemui.statusbar.notification.NotificationEntryManager; |
| 64 | import com.android.systemui.statusbar.notification.NotificationInterruptionStateProvider; |
| 65 | import com.android.systemui.statusbar.notification.NotificationWakeUpCoordinator; |
| 66 | import com.android.systemui.statusbar.notification.VisualStabilityManager; |
| 67 | import com.android.systemui.statusbar.notification.logging.NotifLog; |
| 68 | import com.android.systemui.statusbar.notification.logging.NotificationLogger; |
| 69 | import com.android.systemui.statusbar.notification.row.NotificationGutsManager; |
| 70 | import com.android.systemui.statusbar.phone.AutoHideController; |
| 71 | import com.android.systemui.statusbar.phone.BiometricUnlockController; |
| 72 | import com.android.systemui.statusbar.phone.DozeParameters; |
| 73 | import com.android.systemui.statusbar.phone.DozeScrimController; |
| 74 | import com.android.systemui.statusbar.phone.DozeServiceHost; |
| 75 | import com.android.systemui.statusbar.phone.HeadsUpManagerPhone; |
| 76 | import com.android.systemui.statusbar.phone.KeyguardBypassController; |
| 77 | import com.android.systemui.statusbar.phone.LightBarController; |
| 78 | import com.android.systemui.statusbar.phone.LockscreenWallpaper; |
| 79 | import com.android.systemui.statusbar.phone.NotificationGroupAlertTransferHelper; |
| 80 | import com.android.systemui.statusbar.phone.NotificationGroupManager; |
| 81 | import com.android.systemui.statusbar.phone.ScrimController; |
Dave Mankoff | ae8ec45 | 2019-10-29 15:50:02 -0400 | [diff] [blame] | 82 | import com.android.systemui.statusbar.phone.StatusBar; |
Dave Mankoff | a7ca157 | 2019-10-23 17:09:17 -0400 | [diff] [blame] | 83 | import com.android.systemui.statusbar.phone.StatusBarIconController; |
| 84 | import com.android.systemui.statusbar.phone.StatusBarWindowController; |
| 85 | import com.android.systemui.statusbar.phone.StatusBarWindowViewController; |
| 86 | import com.android.systemui.statusbar.policy.BatteryController; |
| 87 | import com.android.systemui.statusbar.policy.ConfigurationController; |
| 88 | import com.android.systemui.statusbar.policy.DeviceProvisionedController; |
| 89 | import com.android.systemui.statusbar.policy.KeyguardStateController; |
| 90 | import com.android.systemui.statusbar.policy.NetworkController; |
| 91 | import com.android.systemui.statusbar.policy.RemoteInputQuickSettingsDisabler; |
| 92 | import com.android.systemui.statusbar.policy.UserSwitcherController; |
| 93 | import com.android.systemui.statusbar.policy.ZenModeController; |
Dave Mankoff | bcaca8a | 2019-10-31 18:04:08 -0400 | [diff] [blame] | 94 | import com.android.systemui.statusbar.tv.TvStatusBar; |
Fabian Kozynski | 5ca7a51 | 2019-10-16 19:56:11 +0000 | [diff] [blame] | 95 | import com.android.systemui.theme.ThemeOverlayController; |
Dave Mankoff | a7ca157 | 2019-10-23 17:09:17 -0400 | [diff] [blame] | 96 | import com.android.systemui.util.InjectionInflationController; |
Dave Mankoff | ae8ec45 | 2019-10-29 15:50:02 -0400 | [diff] [blame] | 97 | import com.android.systemui.util.leak.GarbageMonitor; |
| 98 | import com.android.systemui.volume.VolumeUI; |
Heemin Seog | 1a39dea | 2019-10-16 15:58:21 -0700 | [diff] [blame] | 99 | |
Dave Mankoff | a7ca157 | 2019-10-23 17:09:17 -0400 | [diff] [blame] | 100 | import javax.inject.Named; |
| 101 | import javax.inject.Singleton; |
| 102 | |
Heemin Seog | 1a39dea | 2019-10-16 15:58:21 -0700 | [diff] [blame] | 103 | import dagger.Binds; |
Dave Mankoff | a7ca157 | 2019-10-23 17:09:17 -0400 | [diff] [blame] | 104 | import dagger.Lazy; |
Heemin Seog | 1a39dea | 2019-10-16 15:58:21 -0700 | [diff] [blame] | 105 | import dagger.Module; |
Dave Mankoff | a7ca157 | 2019-10-23 17:09:17 -0400 | [diff] [blame] | 106 | import dagger.Provides; |
Heemin Seog | 1a39dea | 2019-10-16 15:58:21 -0700 | [diff] [blame] | 107 | import dagger.multibindings.ClassKey; |
| 108 | import dagger.multibindings.IntoMap; |
| 109 | |
| 110 | /** Binder for car specific {@link SystemUI} modules. */ |
Dave Mankoff | ae8ec45 | 2019-10-29 15:50:02 -0400 | [diff] [blame] | 111 | @Module(includes = {RecentsModule.class}) |
Heemin Seog | 1a39dea | 2019-10-16 15:58:21 -0700 | [diff] [blame] | 112 | public abstract class CarSystemUIBinder { |
Dave Mankoff | bcaca8a | 2019-10-31 18:04:08 -0400 | [diff] [blame] | 113 | /** Inject into AuthController. */ |
| 114 | @Binds |
| 115 | @IntoMap |
| 116 | @ClassKey(AuthController.class) |
| 117 | public abstract SystemUI bindAuthController(AuthController service); |
| 118 | |
Heemin Seog | 1a39dea | 2019-10-16 15:58:21 -0700 | [diff] [blame] | 119 | /** */ |
| 120 | @Binds |
| 121 | @IntoMap |
| 122 | @ClassKey(CarNavigationBar.class) |
| 123 | public abstract SystemUI bindCarNavigationBar(CarNavigationBar sysui); |
Dave Mankoff | ae8ec45 | 2019-10-29 15:50:02 -0400 | [diff] [blame] | 124 | |
| 125 | /** Inject into GarbageMonitor.Service. */ |
| 126 | @Binds |
| 127 | @IntoMap |
| 128 | @ClassKey(GarbageMonitor.Service.class) |
| 129 | public abstract SystemUI bindGarbageMonitorService(GarbageMonitor.Service service); |
| 130 | |
Dave Mankoff | bcaca8a | 2019-10-31 18:04:08 -0400 | [diff] [blame] | 131 | /** Inject into GlobalActionsComponent. */ |
| 132 | @Binds |
| 133 | @IntoMap |
| 134 | @ClassKey(GlobalActionsComponent.class) |
| 135 | public abstract SystemUI bindGlobalActionsComponent(GlobalActionsComponent sysui); |
| 136 | |
| 137 | /** Inject into InstantAppNotifier. */ |
| 138 | @Binds |
| 139 | @IntoMap |
| 140 | @ClassKey(InstantAppNotifier.class) |
| 141 | public abstract SystemUI bindInstantAppNotifier(InstantAppNotifier sysui); |
| 142 | |
Dave Mankoff | ae8ec45 | 2019-10-29 15:50:02 -0400 | [diff] [blame] | 143 | /** Inject into KeyguardViewMediator. */ |
| 144 | @Binds |
| 145 | @IntoMap |
| 146 | @ClassKey(KeyguardViewMediator.class) |
| 147 | public abstract SystemUI bindKeyguardViewMediator(KeyguardViewMediator sysui); |
| 148 | |
| 149 | /** Inject into LatencyTests. */ |
| 150 | @Binds |
| 151 | @IntoMap |
| 152 | @ClassKey(LatencyTester.class) |
| 153 | public abstract SystemUI bindLatencyTester(LatencyTester sysui); |
| 154 | |
| 155 | /** Inject into PipUI. */ |
| 156 | @Binds |
| 157 | @IntoMap |
| 158 | @ClassKey(PipUI.class) |
| 159 | public abstract SystemUI bindPipUI(PipUI sysui); |
| 160 | |
| 161 | /** Inject into PowerUI. */ |
| 162 | @Binds |
| 163 | @IntoMap |
| 164 | @ClassKey(PowerUI.class) |
| 165 | public abstract SystemUI bindPowerUI(PowerUI sysui); |
| 166 | |
| 167 | /** Inject into Recents. */ |
| 168 | @Binds |
| 169 | @IntoMap |
| 170 | @ClassKey(Recents.class) |
| 171 | public abstract SystemUI bindRecents(Recents sysui); |
| 172 | |
| 173 | /** Inject into ScreenDecorations. */ |
| 174 | @Binds |
| 175 | @IntoMap |
| 176 | @ClassKey(ScreenDecorations.class) |
| 177 | public abstract SystemUI bindScreenDecorations(ScreenDecorations sysui); |
| 178 | |
Dave Mankoff | bcaca8a | 2019-10-31 18:04:08 -0400 | [diff] [blame] | 179 | /** Inject into SizeCompatModeActivityController. */ |
| 180 | @Binds |
| 181 | @IntoMap |
| 182 | @ClassKey(SizeCompatModeActivityController.class) |
| 183 | public abstract SystemUI bindsSizeCompatModeActivityController( |
| 184 | SizeCompatModeActivityController sysui); |
| 185 | |
Fabian Kozynski | 5ca7a51 | 2019-10-16 19:56:11 +0000 | [diff] [blame] | 186 | /** Inject into SliceBroadcastRelayHandler. */ |
| 187 | @Binds |
| 188 | @IntoMap |
| 189 | @ClassKey(SliceBroadcastRelayHandler.class) |
| 190 | public abstract SystemUI bindSliceBroadcastRelayHandler(SliceBroadcastRelayHandler sysui); |
| 191 | |
| 192 | /** Inject into ThemeOverlayController. */ |
| 193 | @Binds |
| 194 | @IntoMap |
| 195 | @ClassKey(ThemeOverlayController.class) |
| 196 | public abstract SystemUI bindThemeOverlayController(ThemeOverlayController sysui); |
| 197 | |
Dave Mankoff | ae8ec45 | 2019-10-29 15:50:02 -0400 | [diff] [blame] | 198 | /** Inject into StatusBar. */ |
| 199 | @Binds |
| 200 | @IntoMap |
| 201 | @ClassKey(StatusBar.class) |
| 202 | public abstract SystemUI bindsStatusBar(CarStatusBar sysui); |
| 203 | |
Dave Mankoff | bcaca8a | 2019-10-31 18:04:08 -0400 | [diff] [blame] | 204 | /** Inject into TvStatusBar. */ |
| 205 | @Binds |
| 206 | @IntoMap |
| 207 | @ClassKey(TvStatusBar.class) |
| 208 | public abstract SystemUI bindsTvStatusBar(TvStatusBar sysui); |
| 209 | |
Dave Mankoff | ae8ec45 | 2019-10-29 15:50:02 -0400 | [diff] [blame] | 210 | /** Inject into StatusBarGoogle. */ |
| 211 | @Binds |
| 212 | @IntoMap |
| 213 | @ClassKey(CarStatusBar.class) |
| 214 | public abstract SystemUI bindsCarStatusBar(CarStatusBar sysui); |
| 215 | |
| 216 | /** Inject into VolumeUI. */ |
| 217 | @Binds |
| 218 | @IntoMap |
| 219 | @ClassKey(VolumeUI.class) |
| 220 | public abstract SystemUI bindVolumeUI(VolumeUI sysui); |
Dave Mankoff | a7ca157 | 2019-10-23 17:09:17 -0400 | [diff] [blame] | 221 | |
| 222 | /** |
| 223 | * Provides our instance of StatusBar which is considered optional. |
| 224 | */ |
| 225 | @Provides |
| 226 | @Singleton |
| 227 | static CarStatusBar provideStatusBar( |
| 228 | Context context, |
| 229 | FeatureFlags featureFlags, |
| 230 | LightBarController lightBarController, |
| 231 | AutoHideController autoHideController, |
| 232 | KeyguardUpdateMonitor keyguardUpdateMonitor, |
| 233 | StatusBarIconController statusBarIconController, |
| 234 | DozeLog dozeLog, |
| 235 | InjectionInflationController injectionInflationController, |
| 236 | PulseExpansionHandler pulseExpansionHandler, |
| 237 | NotificationWakeUpCoordinator notificationWakeUpCoordinator, |
| 238 | KeyguardBypassController keyguardBypassController, |
| 239 | KeyguardStateController keyguardStateController, |
| 240 | HeadsUpManagerPhone headsUpManagerPhone, |
| 241 | DynamicPrivacyController dynamicPrivacyController, |
| 242 | BypassHeadsUpNotifier bypassHeadsUpNotifier, |
| 243 | @Named(ALLOW_NOTIFICATION_LONG_PRESS_NAME) boolean allowNotificationLongPress, |
| 244 | Lazy<NewNotifPipeline> newNotifPipeline, |
| 245 | FalsingManager falsingManager, |
| 246 | BroadcastDispatcher broadcastDispatcher, |
| 247 | RemoteInputQuickSettingsDisabler remoteInputQuickSettingsDisabler, |
| 248 | NotificationGutsManager notificationGutsManager, |
| 249 | NotificationLogger notificationLogger, |
| 250 | NotificationEntryManager notificationEntryManager, |
| 251 | NotificationInterruptionStateProvider notificationInterruptionStateProvider, |
| 252 | NotificationViewHierarchyManager notificationViewHierarchyManager, |
| 253 | ForegroundServiceController foregroundServiceController, |
| 254 | AppOpsController appOpsController, |
| 255 | KeyguardViewMediator keyguardViewMediator, |
| 256 | ZenModeController zenModeController, |
| 257 | NotificationAlertingManager notificationAlertingManager, |
| 258 | DisplayMetrics displayMetrics, |
| 259 | MetricsLogger metricsLogger, |
| 260 | UiOffloadThread uiOffloadThread, |
| 261 | NotificationMediaManager notificationMediaManager, |
| 262 | NotificationLockscreenUserManager lockScreenUserManager, |
| 263 | NotificationRemoteInputManager remoteInputManager, |
| 264 | UserSwitcherController userSwitcherController, |
| 265 | NetworkController networkController, |
| 266 | BatteryController batteryController, |
| 267 | SysuiColorExtractor colorExtractor, |
| 268 | ScreenLifecycle screenLifecycle, |
| 269 | WakefulnessLifecycle wakefulnessLifecycle, |
| 270 | SysuiStatusBarStateController statusBarStateController, |
| 271 | VibratorHelper vibratorHelper, |
| 272 | BubbleController bubbleController, |
| 273 | NotificationGroupManager groupManager, |
| 274 | NotificationGroupAlertTransferHelper groupAlertTransferHelper, |
| 275 | VisualStabilityManager visualStabilityManager, |
| 276 | DeviceProvisionedController deviceProvisionedController, |
| 277 | NavigationBarController navigationBarController, |
| 278 | AssistManager assistManager, |
| 279 | NotificationListener notificationListener, |
| 280 | ConfigurationController configurationController, |
| 281 | StatusBarWindowController statusBarWindowController, |
| 282 | StatusBarWindowViewController.Builder statusBarWindowViewControllerBuilder, |
| 283 | NotifLog notifLog, |
| 284 | DozeParameters dozeParameters, |
| 285 | ScrimController scrimController, |
| 286 | Lazy<LockscreenWallpaper> lockscreenWallpaperLazy, |
| 287 | Lazy<BiometricUnlockController> biometricUnlockControllerLazy, |
| 288 | DozeServiceHost dozeServiceHost, |
| 289 | PowerManager powerManager, |
| 290 | DozeScrimController dozeScrimController, |
Dave Mankoff | bcaca8a | 2019-10-31 18:04:08 -0400 | [diff] [blame] | 291 | CommandQueue commandQueue, |
Dave Mankoff | 2e48492 | 2019-10-31 12:25:08 -0400 | [diff] [blame] | 292 | PluginManager pluginManager, |
Dave Mankoff | a7ca157 | 2019-10-23 17:09:17 -0400 | [diff] [blame] | 293 | CarNavigationBarController carNavigationBarController) { |
| 294 | return new CarStatusBar( |
| 295 | context, |
| 296 | featureFlags, |
| 297 | lightBarController, |
| 298 | autoHideController, |
| 299 | keyguardUpdateMonitor, |
| 300 | statusBarIconController, |
| 301 | dozeLog, |
| 302 | injectionInflationController, |
| 303 | pulseExpansionHandler, |
| 304 | notificationWakeUpCoordinator, |
| 305 | keyguardBypassController, |
| 306 | keyguardStateController, |
| 307 | headsUpManagerPhone, |
| 308 | dynamicPrivacyController, |
| 309 | bypassHeadsUpNotifier, |
| 310 | allowNotificationLongPress, |
| 311 | newNotifPipeline, |
| 312 | falsingManager, |
| 313 | broadcastDispatcher, |
| 314 | remoteInputQuickSettingsDisabler, |
| 315 | notificationGutsManager, |
| 316 | notificationLogger, |
| 317 | notificationEntryManager, |
| 318 | notificationInterruptionStateProvider, |
| 319 | notificationViewHierarchyManager, |
| 320 | foregroundServiceController, |
| 321 | appOpsController, |
| 322 | keyguardViewMediator, |
| 323 | zenModeController, |
| 324 | notificationAlertingManager, |
| 325 | displayMetrics, |
| 326 | metricsLogger, |
| 327 | uiOffloadThread, |
| 328 | notificationMediaManager, |
| 329 | lockScreenUserManager, |
| 330 | remoteInputManager, |
| 331 | userSwitcherController, |
| 332 | networkController, |
| 333 | batteryController, |
| 334 | colorExtractor, |
| 335 | screenLifecycle, |
| 336 | wakefulnessLifecycle, |
| 337 | statusBarStateController, |
| 338 | vibratorHelper, |
| 339 | bubbleController, |
| 340 | groupManager, |
| 341 | groupAlertTransferHelper, |
| 342 | visualStabilityManager, |
| 343 | deviceProvisionedController, |
| 344 | navigationBarController, |
| 345 | assistManager, |
| 346 | notificationListener, |
| 347 | configurationController, |
| 348 | statusBarWindowController, |
| 349 | statusBarWindowViewControllerBuilder, |
| 350 | notifLog, |
| 351 | dozeParameters, |
| 352 | scrimController, |
| 353 | lockscreenWallpaperLazy, |
| 354 | biometricUnlockControllerLazy, |
| 355 | dozeServiceHost, |
| 356 | powerManager, |
| 357 | dozeScrimController, |
Dave Mankoff | bcaca8a | 2019-10-31 18:04:08 -0400 | [diff] [blame] | 358 | commandQueue, |
Dave Mankoff | 2e48492 | 2019-10-31 12:25:08 -0400 | [diff] [blame] | 359 | pluginManager, |
Dave Mankoff | a7ca157 | 2019-10-23 17:09:17 -0400 | [diff] [blame] | 360 | carNavigationBarController); |
| 361 | } |
Heemin Seog | 1a39dea | 2019-10-16 15:58:21 -0700 | [diff] [blame] | 362 | } |