1 /* 2 * Copyright (C) 2022 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.go; 18 19 import com.android.keyguard.KeyguardBiometricLockoutLogger; 20 import com.android.systemui.CoreStartable; 21 import com.android.systemui.LatencyTester; 22 import com.android.systemui.SliceBroadcastRelayHandler; 23 import com.android.systemui.accessibility.Magnification; 24 import com.android.systemui.back.domain.interactor.BackActionInteractor; 25 import com.android.systemui.clipboardoverlay.ClipboardListener; 26 import com.android.systemui.dagger.qualifiers.PerUser; 27 import com.android.systemui.globalactions.GlobalActionsComponent; 28 import com.android.systemui.keyboard.KeyboardUI; 29 import com.android.systemui.keyguard.KeyguardViewConfigurator; 30 import com.android.systemui.keyguard.KeyguardViewMediator; 31 import com.android.systemui.log.SessionTracker; 32 import com.android.systemui.media.RingtonePlayer; 33 import com.android.systemui.shortcut.ShortcutKeyDispatcher; 34 import com.android.systemui.statusbar.notification.InstantAppNotifier; 35 import com.android.systemui.statusbar.phone.ScrimController; 36 import com.android.systemui.statusbar.phone.StatusBarHeadsUpChangeListener; 37 import com.android.systemui.theme.ThemeOverlayController; 38 import com.android.systemui.usb.StorageNotification; 39 import com.android.systemui.util.NotificationChannels; 40 import com.android.systemui.wmshell.WMShell; 41 42 import dagger.Binds; 43 import dagger.Module; 44 import dagger.multibindings.ClassKey; 45 import dagger.multibindings.IntoMap; 46 47 /** 48 * DEPRECATED: DO NOT ADD THINGS TO THIS FILE. 49 * 50 * Add a feature specific dagger module for what you are working on. Bind your CoreStartable there. 51 * Include that module where it is needed. 52 * 53 * @deprecated 54 */ 55 @Module 56 abstract class SystemUIGoCoreStartableModule { 57 /** Inject into ClipboardListener. */ 58 @Binds 59 @IntoMap 60 @ClassKey(ClipboardListener.class) bindClipboardListener(ClipboardListener clipboardListener)61 abstract CoreStartable bindClipboardListener(ClipboardListener clipboardListener); 62 63 /** Inject into GlobalActionsComponent. */ 64 @Binds 65 @IntoMap 66 @ClassKey(GlobalActionsComponent.class) bindGlobalActionsComponent( GlobalActionsComponent globalActionsComponent)67 abstract CoreStartable bindGlobalActionsComponent( 68 GlobalActionsComponent globalActionsComponent); 69 70 /** Inject into InstantAppNotifier. */ 71 @Binds 72 @IntoMap 73 @ClassKey(InstantAppNotifier.class) bindInstantAppNotifier(InstantAppNotifier instantAppNotifier)74 abstract CoreStartable bindInstantAppNotifier(InstantAppNotifier instantAppNotifier); 75 76 /** Inject into KeyboardUI. */ 77 @Binds 78 @IntoMap 79 @ClassKey(KeyboardUI.class) bindKeyboardUI(KeyboardUI keyboardUI)80 abstract CoreStartable bindKeyboardUI(KeyboardUI keyboardUI); 81 82 /** Inject into KeyguardBiometricLockoutLogger */ 83 @Binds 84 @IntoMap 85 @ClassKey(KeyguardBiometricLockoutLogger.class) bindKeyguardBiometricLockoutLogger( KeyguardBiometricLockoutLogger keyguardBiometricLockoutLogger)86 abstract CoreStartable bindKeyguardBiometricLockoutLogger( 87 KeyguardBiometricLockoutLogger keyguardBiometricLockoutLogger); 88 89 /** Inject into KeyguardViewMediator. */ 90 @Binds 91 @IntoMap 92 @ClassKey(KeyguardViewMediator.class) bindKeyguardViewMediator(KeyguardViewMediator keyguardViewMediator)93 abstract CoreStartable bindKeyguardViewMediator(KeyguardViewMediator keyguardViewMediator); 94 95 /** Inject into LatencyTests. */ 96 @Binds 97 @IntoMap 98 @ClassKey(LatencyTester.class) bindLatencyTester(LatencyTester latencyTester)99 abstract CoreStartable bindLatencyTester(LatencyTester latencyTester); 100 101 /** Inject into NotificationChannels. */ 102 @Binds 103 @IntoMap 104 @ClassKey(NotificationChannels.class) 105 @PerUser bindNotificationChannels(NotificationChannels notificationChannels)106 abstract CoreStartable bindNotificationChannels(NotificationChannels notificationChannels); 107 108 /** Inject into RingtonePlayer. */ 109 @Binds 110 @IntoMap 111 @ClassKey(RingtonePlayer.class) bind(RingtonePlayer ringtonePlayer)112 abstract CoreStartable bind(RingtonePlayer ringtonePlayer); 113 114 /** Inject into SessionTracker. */ 115 @Binds 116 @IntoMap 117 @ClassKey(SessionTracker.class) bindSessionTracker(SessionTracker service)118 abstract CoreStartable bindSessionTracker(SessionTracker service); 119 120 /** Inject into ShortcutKeyDispatcher. */ 121 @Binds 122 @IntoMap 123 @ClassKey(ShortcutKeyDispatcher.class) bindShortcutKeyDispatcher(ShortcutKeyDispatcher shortcutKeyDispatcher)124 abstract CoreStartable bindShortcutKeyDispatcher(ShortcutKeyDispatcher shortcutKeyDispatcher); 125 126 /** Inject into SliceBroadcastRelayHandler. */ 127 @Binds 128 @IntoMap 129 @ClassKey(SliceBroadcastRelayHandler.class) bindSliceBroadcastRelayHandler( SliceBroadcastRelayHandler sliceBroadcastRelayHandler)130 abstract CoreStartable bindSliceBroadcastRelayHandler( 131 SliceBroadcastRelayHandler sliceBroadcastRelayHandler); 132 133 /** Inject into StorageNotification. */ 134 @Binds 135 @IntoMap 136 @ClassKey(StorageNotification.class) bindStorageNotification(StorageNotification storageNotification)137 abstract CoreStartable bindStorageNotification(StorageNotification storageNotification); 138 139 /** Inject into ThemeOverlayController. */ 140 @Binds 141 @IntoMap 142 @ClassKey(ThemeOverlayController.class) bindThemeOverlayController( ThemeOverlayController themeOverlayController)143 abstract CoreStartable bindThemeOverlayController( 144 ThemeOverlayController themeOverlayController); 145 146 /** Inject into Magnification. */ 147 @Binds 148 @IntoMap 149 @ClassKey(Magnification.class) bindMagnification(Magnification magnification)150 abstract CoreStartable bindMagnification(Magnification magnification); 151 152 /** Inject into WMShell. */ 153 @Binds 154 @IntoMap 155 @ClassKey(WMShell.class) bindWMShell(WMShell wmShell)156 abstract CoreStartable bindWMShell(WMShell wmShell); 157 158 @Binds 159 @IntoMap 160 @ClassKey(KeyguardViewConfigurator.class) bindKeyguardViewConfigurator(KeyguardViewConfigurator impl)161 abstract CoreStartable bindKeyguardViewConfigurator(KeyguardViewConfigurator impl); 162 163 /** Inject into ScrimController. */ 164 @Binds 165 @IntoMap 166 @ClassKey(ScrimController.class) bindScrimController(ScrimController scrimController)167 abstract CoreStartable bindScrimController(ScrimController scrimController); 168 169 @Binds 170 @IntoMap 171 @ClassKey(StatusBarHeadsUpChangeListener.class) bindStatusBarHeadsUpChangeListener(StatusBarHeadsUpChangeListener impl)172 abstract CoreStartable bindStatusBarHeadsUpChangeListener(StatusBarHeadsUpChangeListener impl); 173 174 /** Inject into BackActionInteractor. */ 175 @Binds 176 @IntoMap 177 @ClassKey(BackActionInteractor.class) bindBackActionInteractor(BackActionInteractor backActionInteractor)178 abstract CoreStartable bindBackActionInteractor(BackActionInteractor backActionInteractor); 179 } 180