1 /* 2 * Copyright (C) 2020 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.statusbar.phone.dagger; 18 19 import static com.android.systemui.Dependency.TIME_TICK_HANDLER_NAME; 20 21 import android.content.Context; 22 import android.os.Handler; 23 import android.os.PowerManager; 24 import android.util.DisplayMetrics; 25 26 import androidx.annotation.Nullable; 27 28 import com.android.internal.logging.MetricsLogger; 29 import com.android.keyguard.KeyguardUpdateMonitor; 30 import com.android.keyguard.ViewMediatorCallback; 31 import com.android.systemui.InitController; 32 import com.android.systemui.accessibility.floatingmenu.AccessibilityFloatingMenuController; 33 import com.android.systemui.assist.AssistManager; 34 import com.android.systemui.broadcast.BroadcastDispatcher; 35 import com.android.systemui.classifier.FalsingCollector; 36 import com.android.systemui.colorextraction.SysuiColorExtractor; 37 import com.android.systemui.dagger.SysUISingleton; 38 import com.android.systemui.dagger.qualifiers.UiBackground; 39 import com.android.systemui.demomode.DemoModeController; 40 import com.android.systemui.keyguard.DismissCallbackRegistry; 41 import com.android.systemui.keyguard.KeyguardUnlockAnimationController; 42 import com.android.systemui.keyguard.KeyguardViewMediator; 43 import com.android.systemui.keyguard.ScreenLifecycle; 44 import com.android.systemui.keyguard.WakefulnessLifecycle; 45 import com.android.systemui.navigationbar.NavigationBarController; 46 import com.android.systemui.plugins.FalsingManager; 47 import com.android.systemui.plugins.PluginDependencyProvider; 48 import com.android.systemui.recents.ScreenPinningRequest; 49 import com.android.systemui.settings.brightness.BrightnessSlider; 50 import com.android.systemui.shared.plugins.PluginManager; 51 import com.android.systemui.statusbar.CommandQueue; 52 import com.android.systemui.statusbar.FeatureFlags; 53 import com.android.systemui.statusbar.KeyguardIndicationController; 54 import com.android.systemui.statusbar.LockscreenShadeTransitionController; 55 import com.android.systemui.statusbar.NotificationLockscreenUserManager; 56 import com.android.systemui.statusbar.NotificationMediaManager; 57 import com.android.systemui.statusbar.NotificationRemoteInputManager; 58 import com.android.systemui.statusbar.NotificationShadeDepthController; 59 import com.android.systemui.statusbar.NotificationShadeWindowController; 60 import com.android.systemui.statusbar.NotificationViewHierarchyManager; 61 import com.android.systemui.statusbar.PulseExpansionHandler; 62 import com.android.systemui.statusbar.SuperStatusBarViewFactory; 63 import com.android.systemui.statusbar.SysuiStatusBarStateController; 64 import com.android.systemui.statusbar.VibratorHelper; 65 import com.android.systemui.statusbar.charging.WiredChargingRippleController; 66 import com.android.systemui.statusbar.events.SystemStatusAnimationScheduler; 67 import com.android.systemui.statusbar.notification.DynamicPrivacyController; 68 import com.android.systemui.statusbar.notification.NotificationWakeUpCoordinator; 69 import com.android.systemui.statusbar.notification.collection.legacy.VisualStabilityManager; 70 import com.android.systemui.statusbar.notification.init.NotificationsController; 71 import com.android.systemui.statusbar.notification.interruption.BypassHeadsUpNotifier; 72 import com.android.systemui.statusbar.notification.interruption.NotificationInterruptStateProvider; 73 import com.android.systemui.statusbar.notification.logging.NotificationLogger; 74 import com.android.systemui.statusbar.notification.row.NotificationGutsManager; 75 import com.android.systemui.statusbar.phone.AutoHideController; 76 import com.android.systemui.statusbar.phone.BiometricUnlockController; 77 import com.android.systemui.statusbar.phone.DozeParameters; 78 import com.android.systemui.statusbar.phone.DozeScrimController; 79 import com.android.systemui.statusbar.phone.DozeServiceHost; 80 import com.android.systemui.statusbar.phone.HeadsUpManagerPhone; 81 import com.android.systemui.statusbar.phone.KeyguardBypassController; 82 import com.android.systemui.statusbar.phone.KeyguardDismissUtil; 83 import com.android.systemui.statusbar.phone.KeyguardLiftController; 84 import com.android.systemui.statusbar.phone.LightBarController; 85 import com.android.systemui.statusbar.phone.LightsOutNotifController; 86 import com.android.systemui.statusbar.phone.LockscreenWallpaper; 87 import com.android.systemui.statusbar.phone.NotificationIconAreaController; 88 import com.android.systemui.statusbar.phone.PhoneStatusBarPolicy; 89 import com.android.systemui.statusbar.phone.ScrimController; 90 import com.android.systemui.statusbar.phone.ShadeController; 91 import com.android.systemui.statusbar.phone.StatusBar; 92 import com.android.systemui.statusbar.phone.StatusBarIconController; 93 import com.android.systemui.statusbar.phone.StatusBarKeyguardViewManager; 94 import com.android.systemui.statusbar.phone.StatusBarLocationPublisher; 95 import com.android.systemui.statusbar.phone.StatusBarNotificationActivityStarter; 96 import com.android.systemui.statusbar.phone.StatusBarSignalPolicy; 97 import com.android.systemui.statusbar.phone.StatusBarTouchableRegionManager; 98 import com.android.systemui.statusbar.phone.UnlockedScreenOffAnimationController; 99 import com.android.systemui.statusbar.phone.ongoingcall.OngoingCallController; 100 import com.android.systemui.statusbar.policy.BatteryController; 101 import com.android.systemui.statusbar.policy.ConfigurationController; 102 import com.android.systemui.statusbar.policy.DeviceProvisionedController; 103 import com.android.systemui.statusbar.policy.ExtensionController; 104 import com.android.systemui.statusbar.policy.KeyguardStateController; 105 import com.android.systemui.statusbar.policy.NetworkController; 106 import com.android.systemui.statusbar.policy.RemoteInputQuickSettingsDisabler; 107 import com.android.systemui.statusbar.policy.UserInfoControllerImpl; 108 import com.android.systemui.statusbar.policy.UserSwitcherController; 109 import com.android.systemui.volume.VolumeComponent; 110 import com.android.systemui.wmshell.BubblesManager; 111 import com.android.wm.shell.bubbles.Bubbles; 112 import com.android.wm.shell.legacysplitscreen.LegacySplitScreen; 113 import com.android.wm.shell.startingsurface.StartingSurface; 114 115 import java.util.Optional; 116 import java.util.concurrent.Executor; 117 118 import javax.inject.Named; 119 import javax.inject.Provider; 120 121 import dagger.Lazy; 122 import dagger.Module; 123 import dagger.Provides; 124 125 /** 126 * Dagger Module providing {@link StatusBar}. 127 */ 128 @Module(includes = {StatusBarPhoneDependenciesModule.class}) 129 public interface StatusBarPhoneModule { 130 /** 131 * Provides our instance of StatusBar which is considered optional. 132 */ 133 @Provides 134 @SysUISingleton provideStatusBar( Context context, NotificationsController notificationsController, LightBarController lightBarController, AutoHideController autoHideController, KeyguardUpdateMonitor keyguardUpdateMonitor, StatusBarSignalPolicy signalPolicy, PulseExpansionHandler pulseExpansionHandler, NotificationWakeUpCoordinator notificationWakeUpCoordinator, KeyguardBypassController keyguardBypassController, KeyguardStateController keyguardStateController, HeadsUpManagerPhone headsUpManagerPhone, DynamicPrivacyController dynamicPrivacyController, BypassHeadsUpNotifier bypassHeadsUpNotifier, FalsingManager falsingManager, FalsingCollector falsingCollector, BroadcastDispatcher broadcastDispatcher, RemoteInputQuickSettingsDisabler remoteInputQuickSettingsDisabler, NotificationGutsManager notificationGutsManager, NotificationLogger notificationLogger, NotificationInterruptStateProvider notificationInterruptStateProvider, NotificationViewHierarchyManager notificationViewHierarchyManager, KeyguardViewMediator keyguardViewMediator, DisplayMetrics displayMetrics, MetricsLogger metricsLogger, @UiBackground Executor uiBgExecutor, NotificationMediaManager notificationMediaManager, NotificationLockscreenUserManager lockScreenUserManager, NotificationRemoteInputManager remoteInputManager, UserSwitcherController userSwitcherController, NetworkController networkController, BatteryController batteryController, SysuiColorExtractor colorExtractor, ScreenLifecycle screenLifecycle, WakefulnessLifecycle wakefulnessLifecycle, SysuiStatusBarStateController statusBarStateController, VibratorHelper vibratorHelper, Optional<BubblesManager> bubblesManagerOptional, Optional<Bubbles> bubblesOptional, VisualStabilityManager visualStabilityManager, DeviceProvisionedController deviceProvisionedController, NavigationBarController navigationBarController, AccessibilityFloatingMenuController accessibilityFloatingMenuController, Lazy<AssistManager> assistManagerLazy, ConfigurationController configurationController, NotificationShadeWindowController notificationShadeWindowController, DozeParameters dozeParameters, ScrimController scrimController, @Nullable KeyguardLiftController keyguardLiftController, Lazy<LockscreenWallpaper> lockscreenWallpaperLazy, Lazy<BiometricUnlockController> biometricUnlockControllerLazy, DozeServiceHost dozeServiceHost, PowerManager powerManager, ScreenPinningRequest screenPinningRequest, DozeScrimController dozeScrimController, VolumeComponent volumeComponent, CommandQueue commandQueue, Provider<StatusBarComponent.Builder> statusBarComponentBuilder, PluginManager pluginManager, Optional<LegacySplitScreen> splitScreenOptional, LightsOutNotifController lightsOutNotifController, StatusBarNotificationActivityStarter.Builder statusBarNotificationActivityStarterBuilder, ShadeController shadeController, SuperStatusBarViewFactory superStatusBarViewFactory, StatusBarKeyguardViewManager statusBarKeyguardViewManager, ViewMediatorCallback viewMediatorCallback, InitController initController, @Named(TIME_TICK_HANDLER_NAME) Handler timeTickHandler, PluginDependencyProvider pluginDependencyProvider, KeyguardDismissUtil keyguardDismissUtil, ExtensionController extensionController, UserInfoControllerImpl userInfoControllerImpl, PhoneStatusBarPolicy phoneStatusBarPolicy, KeyguardIndicationController keyguardIndicationController, DemoModeController demoModeController, Lazy<NotificationShadeDepthController> notificationShadeDepthController, DismissCallbackRegistry dismissCallbackRegistry, StatusBarTouchableRegionManager statusBarTouchableRegionManager, NotificationIconAreaController notificationIconAreaController, BrightnessSlider.Factory brightnessSliderFactory, WiredChargingRippleController chargingRippleAnimationController, OngoingCallController ongoingCallController, SystemStatusAnimationScheduler animationScheduler, StatusBarLocationPublisher locationPublisher, StatusBarIconController statusBarIconController, LockscreenShadeTransitionController transitionController, FeatureFlags featureFlags, KeyguardUnlockAnimationController keyguardUnlockAnimationController, UnlockedScreenOffAnimationController unlockedScreenOffAnimationController, Optional<StartingSurface> startingSurfaceOptional)135 static StatusBar provideStatusBar( 136 Context context, 137 NotificationsController notificationsController, 138 LightBarController lightBarController, 139 AutoHideController autoHideController, 140 KeyguardUpdateMonitor keyguardUpdateMonitor, 141 StatusBarSignalPolicy signalPolicy, 142 PulseExpansionHandler pulseExpansionHandler, 143 NotificationWakeUpCoordinator notificationWakeUpCoordinator, 144 KeyguardBypassController keyguardBypassController, 145 KeyguardStateController keyguardStateController, 146 HeadsUpManagerPhone headsUpManagerPhone, 147 DynamicPrivacyController dynamicPrivacyController, 148 BypassHeadsUpNotifier bypassHeadsUpNotifier, 149 FalsingManager falsingManager, 150 FalsingCollector falsingCollector, 151 BroadcastDispatcher broadcastDispatcher, 152 RemoteInputQuickSettingsDisabler remoteInputQuickSettingsDisabler, 153 NotificationGutsManager notificationGutsManager, 154 NotificationLogger notificationLogger, 155 NotificationInterruptStateProvider notificationInterruptStateProvider, 156 NotificationViewHierarchyManager notificationViewHierarchyManager, 157 KeyguardViewMediator keyguardViewMediator, 158 DisplayMetrics displayMetrics, 159 MetricsLogger metricsLogger, 160 @UiBackground Executor uiBgExecutor, 161 NotificationMediaManager notificationMediaManager, 162 NotificationLockscreenUserManager lockScreenUserManager, 163 NotificationRemoteInputManager remoteInputManager, 164 UserSwitcherController userSwitcherController, 165 NetworkController networkController, 166 BatteryController batteryController, 167 SysuiColorExtractor colorExtractor, 168 ScreenLifecycle screenLifecycle, 169 WakefulnessLifecycle wakefulnessLifecycle, 170 SysuiStatusBarStateController statusBarStateController, 171 VibratorHelper vibratorHelper, 172 Optional<BubblesManager> bubblesManagerOptional, 173 Optional<Bubbles> bubblesOptional, 174 VisualStabilityManager visualStabilityManager, 175 DeviceProvisionedController deviceProvisionedController, 176 NavigationBarController navigationBarController, 177 AccessibilityFloatingMenuController accessibilityFloatingMenuController, 178 Lazy<AssistManager> assistManagerLazy, 179 ConfigurationController configurationController, 180 NotificationShadeWindowController notificationShadeWindowController, 181 DozeParameters dozeParameters, 182 ScrimController scrimController, 183 @Nullable KeyguardLiftController keyguardLiftController, 184 Lazy<LockscreenWallpaper> lockscreenWallpaperLazy, 185 Lazy<BiometricUnlockController> biometricUnlockControllerLazy, 186 DozeServiceHost dozeServiceHost, 187 PowerManager powerManager, 188 ScreenPinningRequest screenPinningRequest, 189 DozeScrimController dozeScrimController, 190 VolumeComponent volumeComponent, 191 CommandQueue commandQueue, 192 Provider<StatusBarComponent.Builder> statusBarComponentBuilder, 193 PluginManager pluginManager, 194 Optional<LegacySplitScreen> splitScreenOptional, 195 LightsOutNotifController lightsOutNotifController, 196 StatusBarNotificationActivityStarter.Builder 197 statusBarNotificationActivityStarterBuilder, 198 ShadeController shadeController, 199 SuperStatusBarViewFactory superStatusBarViewFactory, 200 StatusBarKeyguardViewManager statusBarKeyguardViewManager, 201 ViewMediatorCallback viewMediatorCallback, 202 InitController initController, 203 @Named(TIME_TICK_HANDLER_NAME) Handler timeTickHandler, 204 PluginDependencyProvider pluginDependencyProvider, 205 KeyguardDismissUtil keyguardDismissUtil, 206 ExtensionController extensionController, 207 UserInfoControllerImpl userInfoControllerImpl, 208 PhoneStatusBarPolicy phoneStatusBarPolicy, 209 KeyguardIndicationController keyguardIndicationController, 210 DemoModeController demoModeController, 211 Lazy<NotificationShadeDepthController> notificationShadeDepthController, 212 DismissCallbackRegistry dismissCallbackRegistry, 213 StatusBarTouchableRegionManager statusBarTouchableRegionManager, 214 NotificationIconAreaController notificationIconAreaController, 215 BrightnessSlider.Factory brightnessSliderFactory, 216 WiredChargingRippleController chargingRippleAnimationController, 217 OngoingCallController ongoingCallController, 218 SystemStatusAnimationScheduler animationScheduler, 219 StatusBarLocationPublisher locationPublisher, 220 StatusBarIconController statusBarIconController, 221 LockscreenShadeTransitionController transitionController, 222 FeatureFlags featureFlags, 223 KeyguardUnlockAnimationController keyguardUnlockAnimationController, 224 UnlockedScreenOffAnimationController unlockedScreenOffAnimationController, 225 Optional<StartingSurface> startingSurfaceOptional) { 226 return new StatusBar( 227 context, 228 notificationsController, 229 lightBarController, 230 autoHideController, 231 keyguardUpdateMonitor, 232 signalPolicy, 233 pulseExpansionHandler, 234 notificationWakeUpCoordinator, 235 keyguardBypassController, 236 keyguardStateController, 237 headsUpManagerPhone, 238 dynamicPrivacyController, 239 bypassHeadsUpNotifier, 240 falsingManager, 241 falsingCollector, 242 broadcastDispatcher, 243 remoteInputQuickSettingsDisabler, 244 notificationGutsManager, 245 notificationLogger, 246 notificationInterruptStateProvider, 247 notificationViewHierarchyManager, 248 keyguardViewMediator, 249 displayMetrics, 250 metricsLogger, 251 uiBgExecutor, 252 notificationMediaManager, 253 lockScreenUserManager, 254 remoteInputManager, 255 userSwitcherController, 256 networkController, 257 batteryController, 258 colorExtractor, 259 screenLifecycle, 260 wakefulnessLifecycle, 261 statusBarStateController, 262 vibratorHelper, 263 bubblesManagerOptional, 264 bubblesOptional, 265 visualStabilityManager, 266 deviceProvisionedController, 267 navigationBarController, 268 accessibilityFloatingMenuController, 269 assistManagerLazy, 270 configurationController, 271 notificationShadeWindowController, 272 dozeParameters, 273 scrimController, 274 keyguardLiftController, 275 lockscreenWallpaperLazy, 276 biometricUnlockControllerLazy, 277 dozeServiceHost, 278 powerManager, 279 screenPinningRequest, 280 dozeScrimController, 281 volumeComponent, 282 commandQueue, 283 statusBarComponentBuilder, 284 pluginManager, 285 splitScreenOptional, 286 lightsOutNotifController, 287 statusBarNotificationActivityStarterBuilder, 288 shadeController, 289 superStatusBarViewFactory, 290 statusBarKeyguardViewManager, 291 viewMediatorCallback, 292 initController, 293 timeTickHandler, 294 pluginDependencyProvider, 295 keyguardDismissUtil, 296 extensionController, 297 userInfoControllerImpl, 298 phoneStatusBarPolicy, 299 keyguardIndicationController, 300 dismissCallbackRegistry, 301 demoModeController, 302 notificationShadeDepthController, 303 statusBarTouchableRegionManager, 304 notificationIconAreaController, 305 brightnessSliderFactory, 306 chargingRippleAnimationController, 307 ongoingCallController, 308 animationScheduler, 309 locationPublisher, 310 statusBarIconController, 311 transitionController, 312 featureFlags, 313 keyguardUnlockAnimationController, 314 unlockedScreenOffAnimationController, 315 startingSurfaceOptional); 316 } 317 } 318