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; |
Dave Mankoff | a7ca157 | 2019-10-23 17:09:17 -0400 | [diff] [blame] | 95 | import com.android.systemui.util.InjectionInflationController; |
Dave Mankoff | ae8ec45 | 2019-10-29 15:50:02 -0400 | [diff] [blame] | 96 | import com.android.systemui.util.leak.GarbageMonitor; |
| 97 | import com.android.systemui.volume.VolumeUI; |
Heemin Seog | 1a39dea | 2019-10-16 15:58:21 -0700 | [diff] [blame] | 98 | |
Dave Mankoff | a7ca157 | 2019-10-23 17:09:17 -0400 | [diff] [blame] | 99 | import javax.inject.Named; |
| 100 | import javax.inject.Singleton; |
| 101 | |
Heemin Seog | 1a39dea | 2019-10-16 15:58:21 -0700 | [diff] [blame] | 102 | import dagger.Binds; |
Dave Mankoff | a7ca157 | 2019-10-23 17:09:17 -0400 | [diff] [blame] | 103 | import dagger.Lazy; |
Heemin Seog | 1a39dea | 2019-10-16 15:58:21 -0700 | [diff] [blame] | 104 | import dagger.Module; |
Dave Mankoff | a7ca157 | 2019-10-23 17:09:17 -0400 | [diff] [blame] | 105 | import dagger.Provides; |
Heemin Seog | 1a39dea | 2019-10-16 15:58:21 -0700 | [diff] [blame] | 106 | import dagger.multibindings.ClassKey; |
| 107 | import dagger.multibindings.IntoMap; |
| 108 | |
| 109 | /** Binder for car specific {@link SystemUI} modules. */ |
Dave Mankoff | ae8ec45 | 2019-10-29 15:50:02 -0400 | [diff] [blame] | 110 | @Module(includes = {RecentsModule.class}) |
Heemin Seog | 1a39dea | 2019-10-16 15:58:21 -0700 | [diff] [blame] | 111 | public abstract class CarSystemUIBinder { |
Dave Mankoff | bcaca8a | 2019-10-31 18:04:08 -0400 | [diff] [blame] | 112 | /** Inject into AuthController. */ |
| 113 | @Binds |
| 114 | @IntoMap |
| 115 | @ClassKey(AuthController.class) |
| 116 | public abstract SystemUI bindAuthController(AuthController service); |
| 117 | |
Heemin Seog | 1a39dea | 2019-10-16 15:58:21 -0700 | [diff] [blame] | 118 | /** */ |
| 119 | @Binds |
| 120 | @IntoMap |
| 121 | @ClassKey(CarNavigationBar.class) |
| 122 | public abstract SystemUI bindCarNavigationBar(CarNavigationBar sysui); |
Dave Mankoff | ae8ec45 | 2019-10-29 15:50:02 -0400 | [diff] [blame] | 123 | |
| 124 | /** Inject into GarbageMonitor.Service. */ |
| 125 | @Binds |
| 126 | @IntoMap |
| 127 | @ClassKey(GarbageMonitor.Service.class) |
| 128 | public abstract SystemUI bindGarbageMonitorService(GarbageMonitor.Service service); |
| 129 | |
Dave Mankoff | bcaca8a | 2019-10-31 18:04:08 -0400 | [diff] [blame] | 130 | /** Inject into GlobalActionsComponent. */ |
| 131 | @Binds |
| 132 | @IntoMap |
| 133 | @ClassKey(GlobalActionsComponent.class) |
| 134 | public abstract SystemUI bindGlobalActionsComponent(GlobalActionsComponent sysui); |
| 135 | |
| 136 | /** Inject into InstantAppNotifier. */ |
| 137 | @Binds |
| 138 | @IntoMap |
| 139 | @ClassKey(InstantAppNotifier.class) |
| 140 | public abstract SystemUI bindInstantAppNotifier(InstantAppNotifier sysui); |
| 141 | |
Dave Mankoff | ae8ec45 | 2019-10-29 15:50:02 -0400 | [diff] [blame] | 142 | /** Inject into KeyguardViewMediator. */ |
| 143 | @Binds |
| 144 | @IntoMap |
| 145 | @ClassKey(KeyguardViewMediator.class) |
| 146 | public abstract SystemUI bindKeyguardViewMediator(KeyguardViewMediator sysui); |
| 147 | |
| 148 | /** Inject into LatencyTests. */ |
| 149 | @Binds |
| 150 | @IntoMap |
| 151 | @ClassKey(LatencyTester.class) |
| 152 | public abstract SystemUI bindLatencyTester(LatencyTester sysui); |
| 153 | |
| 154 | /** Inject into PipUI. */ |
| 155 | @Binds |
| 156 | @IntoMap |
| 157 | @ClassKey(PipUI.class) |
| 158 | public abstract SystemUI bindPipUI(PipUI sysui); |
| 159 | |
| 160 | /** Inject into PowerUI. */ |
| 161 | @Binds |
| 162 | @IntoMap |
| 163 | @ClassKey(PowerUI.class) |
| 164 | public abstract SystemUI bindPowerUI(PowerUI sysui); |
| 165 | |
| 166 | /** Inject into Recents. */ |
| 167 | @Binds |
| 168 | @IntoMap |
| 169 | @ClassKey(Recents.class) |
| 170 | public abstract SystemUI bindRecents(Recents sysui); |
| 171 | |
| 172 | /** Inject into ScreenDecorations. */ |
| 173 | @Binds |
| 174 | @IntoMap |
| 175 | @ClassKey(ScreenDecorations.class) |
| 176 | public abstract SystemUI bindScreenDecorations(ScreenDecorations sysui); |
| 177 | |
Dave Mankoff | bcaca8a | 2019-10-31 18:04:08 -0400 | [diff] [blame] | 178 | /** Inject into SizeCompatModeActivityController. */ |
| 179 | @Binds |
| 180 | @IntoMap |
| 181 | @ClassKey(SizeCompatModeActivityController.class) |
| 182 | public abstract SystemUI bindsSizeCompatModeActivityController( |
| 183 | SizeCompatModeActivityController sysui); |
| 184 | |
Dave Mankoff | ae8ec45 | 2019-10-29 15:50:02 -0400 | [diff] [blame] | 185 | /** Inject into StatusBar. */ |
| 186 | @Binds |
| 187 | @IntoMap |
| 188 | @ClassKey(StatusBar.class) |
| 189 | public abstract SystemUI bindsStatusBar(CarStatusBar sysui); |
| 190 | |
Dave Mankoff | bcaca8a | 2019-10-31 18:04:08 -0400 | [diff] [blame] | 191 | /** Inject into TvStatusBar. */ |
| 192 | @Binds |
| 193 | @IntoMap |
| 194 | @ClassKey(TvStatusBar.class) |
| 195 | public abstract SystemUI bindsTvStatusBar(TvStatusBar sysui); |
| 196 | |
Dave Mankoff | ae8ec45 | 2019-10-29 15:50:02 -0400 | [diff] [blame] | 197 | /** Inject into StatusBarGoogle. */ |
| 198 | @Binds |
| 199 | @IntoMap |
| 200 | @ClassKey(CarStatusBar.class) |
| 201 | public abstract SystemUI bindsCarStatusBar(CarStatusBar sysui); |
| 202 | |
| 203 | /** Inject into VolumeUI. */ |
| 204 | @Binds |
| 205 | @IntoMap |
| 206 | @ClassKey(VolumeUI.class) |
| 207 | public abstract SystemUI bindVolumeUI(VolumeUI sysui); |
Dave Mankoff | a7ca157 | 2019-10-23 17:09:17 -0400 | [diff] [blame] | 208 | |
| 209 | /** |
| 210 | * Provides our instance of StatusBar which is considered optional. |
| 211 | */ |
| 212 | @Provides |
| 213 | @Singleton |
| 214 | static CarStatusBar provideStatusBar( |
| 215 | Context context, |
| 216 | FeatureFlags featureFlags, |
| 217 | LightBarController lightBarController, |
| 218 | AutoHideController autoHideController, |
| 219 | KeyguardUpdateMonitor keyguardUpdateMonitor, |
| 220 | StatusBarIconController statusBarIconController, |
| 221 | DozeLog dozeLog, |
| 222 | InjectionInflationController injectionInflationController, |
| 223 | PulseExpansionHandler pulseExpansionHandler, |
| 224 | NotificationWakeUpCoordinator notificationWakeUpCoordinator, |
| 225 | KeyguardBypassController keyguardBypassController, |
| 226 | KeyguardStateController keyguardStateController, |
| 227 | HeadsUpManagerPhone headsUpManagerPhone, |
| 228 | DynamicPrivacyController dynamicPrivacyController, |
| 229 | BypassHeadsUpNotifier bypassHeadsUpNotifier, |
| 230 | @Named(ALLOW_NOTIFICATION_LONG_PRESS_NAME) boolean allowNotificationLongPress, |
| 231 | Lazy<NewNotifPipeline> newNotifPipeline, |
| 232 | FalsingManager falsingManager, |
| 233 | BroadcastDispatcher broadcastDispatcher, |
| 234 | RemoteInputQuickSettingsDisabler remoteInputQuickSettingsDisabler, |
| 235 | NotificationGutsManager notificationGutsManager, |
| 236 | NotificationLogger notificationLogger, |
| 237 | NotificationEntryManager notificationEntryManager, |
| 238 | NotificationInterruptionStateProvider notificationInterruptionStateProvider, |
| 239 | NotificationViewHierarchyManager notificationViewHierarchyManager, |
| 240 | ForegroundServiceController foregroundServiceController, |
| 241 | AppOpsController appOpsController, |
| 242 | KeyguardViewMediator keyguardViewMediator, |
| 243 | ZenModeController zenModeController, |
| 244 | NotificationAlertingManager notificationAlertingManager, |
| 245 | DisplayMetrics displayMetrics, |
| 246 | MetricsLogger metricsLogger, |
| 247 | UiOffloadThread uiOffloadThread, |
| 248 | NotificationMediaManager notificationMediaManager, |
| 249 | NotificationLockscreenUserManager lockScreenUserManager, |
| 250 | NotificationRemoteInputManager remoteInputManager, |
| 251 | UserSwitcherController userSwitcherController, |
| 252 | NetworkController networkController, |
| 253 | BatteryController batteryController, |
| 254 | SysuiColorExtractor colorExtractor, |
| 255 | ScreenLifecycle screenLifecycle, |
| 256 | WakefulnessLifecycle wakefulnessLifecycle, |
| 257 | SysuiStatusBarStateController statusBarStateController, |
| 258 | VibratorHelper vibratorHelper, |
| 259 | BubbleController bubbleController, |
| 260 | NotificationGroupManager groupManager, |
| 261 | NotificationGroupAlertTransferHelper groupAlertTransferHelper, |
| 262 | VisualStabilityManager visualStabilityManager, |
| 263 | DeviceProvisionedController deviceProvisionedController, |
| 264 | NavigationBarController navigationBarController, |
| 265 | AssistManager assistManager, |
| 266 | NotificationListener notificationListener, |
| 267 | ConfigurationController configurationController, |
| 268 | StatusBarWindowController statusBarWindowController, |
| 269 | StatusBarWindowViewController.Builder statusBarWindowViewControllerBuilder, |
| 270 | NotifLog notifLog, |
| 271 | DozeParameters dozeParameters, |
| 272 | ScrimController scrimController, |
| 273 | Lazy<LockscreenWallpaper> lockscreenWallpaperLazy, |
| 274 | Lazy<BiometricUnlockController> biometricUnlockControllerLazy, |
| 275 | DozeServiceHost dozeServiceHost, |
| 276 | PowerManager powerManager, |
| 277 | DozeScrimController dozeScrimController, |
Dave Mankoff | bcaca8a | 2019-10-31 18:04:08 -0400 | [diff] [blame] | 278 | CommandQueue commandQueue, |
Dave Mankoff | 2e48492 | 2019-10-31 12:25:08 -0400 | [diff] [blame] | 279 | PluginManager pluginManager, |
Dave Mankoff | a7ca157 | 2019-10-23 17:09:17 -0400 | [diff] [blame] | 280 | CarNavigationBarController carNavigationBarController) { |
| 281 | return new CarStatusBar( |
| 282 | context, |
| 283 | featureFlags, |
| 284 | lightBarController, |
| 285 | autoHideController, |
| 286 | keyguardUpdateMonitor, |
| 287 | statusBarIconController, |
| 288 | dozeLog, |
| 289 | injectionInflationController, |
| 290 | pulseExpansionHandler, |
| 291 | notificationWakeUpCoordinator, |
| 292 | keyguardBypassController, |
| 293 | keyguardStateController, |
| 294 | headsUpManagerPhone, |
| 295 | dynamicPrivacyController, |
| 296 | bypassHeadsUpNotifier, |
| 297 | allowNotificationLongPress, |
| 298 | newNotifPipeline, |
| 299 | falsingManager, |
| 300 | broadcastDispatcher, |
| 301 | remoteInputQuickSettingsDisabler, |
| 302 | notificationGutsManager, |
| 303 | notificationLogger, |
| 304 | notificationEntryManager, |
| 305 | notificationInterruptionStateProvider, |
| 306 | notificationViewHierarchyManager, |
| 307 | foregroundServiceController, |
| 308 | appOpsController, |
| 309 | keyguardViewMediator, |
| 310 | zenModeController, |
| 311 | notificationAlertingManager, |
| 312 | displayMetrics, |
| 313 | metricsLogger, |
| 314 | uiOffloadThread, |
| 315 | notificationMediaManager, |
| 316 | lockScreenUserManager, |
| 317 | remoteInputManager, |
| 318 | userSwitcherController, |
| 319 | networkController, |
| 320 | batteryController, |
| 321 | colorExtractor, |
| 322 | screenLifecycle, |
| 323 | wakefulnessLifecycle, |
| 324 | statusBarStateController, |
| 325 | vibratorHelper, |
| 326 | bubbleController, |
| 327 | groupManager, |
| 328 | groupAlertTransferHelper, |
| 329 | visualStabilityManager, |
| 330 | deviceProvisionedController, |
| 331 | navigationBarController, |
| 332 | assistManager, |
| 333 | notificationListener, |
| 334 | configurationController, |
| 335 | statusBarWindowController, |
| 336 | statusBarWindowViewControllerBuilder, |
| 337 | notifLog, |
| 338 | dozeParameters, |
| 339 | scrimController, |
| 340 | lockscreenWallpaperLazy, |
| 341 | biometricUnlockControllerLazy, |
| 342 | dozeServiceHost, |
| 343 | powerManager, |
| 344 | dozeScrimController, |
Dave Mankoff | bcaca8a | 2019-10-31 18:04:08 -0400 | [diff] [blame] | 345 | commandQueue, |
Dave Mankoff | 2e48492 | 2019-10-31 12:25:08 -0400 | [diff] [blame] | 346 | pluginManager, |
Dave Mankoff | a7ca157 | 2019-10-23 17:09:17 -0400 | [diff] [blame] | 347 | carNavigationBarController); |
| 348 | } |
Heemin Seog | 1a39dea | 2019-10-16 15:58:21 -0700 | [diff] [blame] | 349 | } |