/* * Copyright (C) 2022 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.car.keyguard; import android.app.IActivityTaskManager; import android.app.trust.TrustManager; import android.content.Context; import android.os.PowerManager; import com.android.internal.jank.InteractionJankMonitor; import com.android.internal.logging.UiEventLogger; import com.android.internal.widget.LockPatternUtils; import com.android.keyguard.KeyguardDisplayManager; import com.android.keyguard.KeyguardUpdateMonitor; import com.android.keyguard.KeyguardViewController; import com.android.keyguard.ViewMediatorCallback; import com.android.keyguard.dagger.KeyguardQsUserSwitchComponent; import com.android.keyguard.dagger.KeyguardStatusBarViewComponent; import com.android.keyguard.dagger.KeyguardStatusViewComponent; import com.android.keyguard.dagger.KeyguardUserSwitcherComponent; import com.android.keyguard.mediator.ScreenOnCoordinator; import com.android.systemui.CoreStartable; import com.android.systemui.animation.ActivityTransitionAnimator; import com.android.systemui.broadcast.BroadcastDispatcher; import com.android.systemui.classifier.FalsingCollector; import com.android.systemui.classifier.FalsingModule; import com.android.systemui.communal.ui.viewmodel.CommunalTransitionViewModel; import com.android.systemui.dagger.SysUISingleton; import com.android.systemui.dagger.qualifiers.Main; import com.android.systemui.dagger.qualifiers.UiBackground; import com.android.systemui.dreams.DreamOverlayStateController; import com.android.systemui.dreams.ui.viewmodel.DreamViewModel; import com.android.systemui.dump.DumpManager; import com.android.systemui.flags.FeatureFlags; import com.android.systemui.flags.SystemPropertiesHelper; import com.android.systemui.keyguard.DismissCallbackRegistry; import com.android.systemui.keyguard.KeyguardUnlockAnimationController; import com.android.systemui.keyguard.KeyguardViewMediator; import com.android.systemui.keyguard.WindowManagerLockscreenVisibilityManager; import com.android.systemui.keyguard.WindowManagerOcclusionManager; import com.android.systemui.keyguard.dagger.KeyguardFaceAuthNotSupportedModule; import com.android.systemui.keyguard.data.repository.KeyguardRepositoryModule; import com.android.systemui.keyguard.domain.interactor.KeyguardInteractor; import com.android.systemui.log.SessionTracker; import com.android.systemui.navigationbar.NavigationModeController; import com.android.systemui.settings.UserTracker; import com.android.systemui.shade.ShadeController; import com.android.systemui.statusbar.NotificationShadeDepthController; import com.android.systemui.statusbar.NotificationShadeWindowController; import com.android.systemui.statusbar.SysuiStatusBarStateController; import com.android.systemui.statusbar.phone.DozeParameters; import com.android.systemui.statusbar.phone.ScreenOffAnimationController; import com.android.systemui.statusbar.phone.ScrimController; import com.android.systemui.statusbar.policy.KeyguardStateController; import com.android.systemui.statusbar.policy.UserSwitcherController; import com.android.systemui.user.domain.interactor.SelectedUserInteractor; import com.android.systemui.util.DeviceConfigProxy; import com.android.systemui.util.kotlin.JavaAdapter; import com.android.systemui.util.settings.SecureSettings; import com.android.systemui.util.settings.SystemSettings; import com.android.systemui.util.time.SystemClock; import com.android.systemui.wallpapers.data.repository.WallpaperRepository; import com.android.wm.shell.keyguard.KeyguardTransitions; import dagger.Binds; import dagger.Lazy; import dagger.Module; import dagger.Provides; import dagger.multibindings.ClassKey; import dagger.multibindings.IntoMap; import java.util.concurrent.Executor; import kotlinx.coroutines.CoroutineDispatcher; /** * Dagger Module providing keyguard. */ @Module(subcomponents = { KeyguardQsUserSwitchComponent.class, KeyguardStatusBarViewComponent.class, KeyguardStatusViewComponent.class, KeyguardUserSwitcherComponent.class}, includes = { FalsingModule.class, KeyguardFaceAuthNotSupportedModule.class, KeyguardRepositoryModule.class, }) public interface CarKeyguardModule { /** * Provides our instance of CarKeyguardViewMediator */ @Provides @SysUISingleton static KeyguardViewMediator newKeyguardViewMediator( Context context, UiEventLogger uiEventLogger, SessionTracker sessionTracker, UserTracker userTracker, FalsingCollector falsingCollector, LockPatternUtils lockPatternUtils, BroadcastDispatcher broadcastDispatcher, Lazy statusBarKeyguardViewManagerLazy, DismissCallbackRegistry dismissCallbackRegistry, KeyguardUpdateMonitor updateMonitor, DumpManager dumpManager, PowerManager powerManager, TrustManager trustManager, UserSwitcherController userSwitcherController, @UiBackground Executor uiBgExecutor, DeviceConfigProxy deviceConfig, NavigationModeController navigationModeController, KeyguardDisplayManager keyguardDisplayManager, DozeParameters dozeParameters, SysuiStatusBarStateController statusBarStateController, KeyguardStateController keyguardStateController, Lazy keyguardUnlockAnimationController, ScreenOffAnimationController screenOffAnimationController, Lazy notificationShadeDepthController, ScreenOnCoordinator screenOnCoordinator, KeyguardTransitions keyguardTransitions, InteractionJankMonitor interactionJankMonitor, DreamOverlayStateController dreamOverlayStateController, JavaAdapter javaAdapter, WallpaperRepository wallpaperRepository, Lazy shadeController, Lazy notificationShadeWindowController, Lazy activityTransitionAnimator, Lazy scrimControllerLazy, IActivityTaskManager activityTaskManagerService, FeatureFlags featureFlags, SecureSettings secureSettings, SystemSettings systemSettings, SystemClock systemClock, @Main CoroutineDispatcher mainDispatcher, Lazy dreamViewModel, Lazy communalTransitionViewModel, SystemPropertiesHelper systemPropertiesHelper, Lazy wmLockscreenVisibilityManager, SelectedUserInteractor selectedUserInteractor, KeyguardInteractor keyguardInteractor, WindowManagerOcclusionManager wmOcclusionManager) { return new CarKeyguardViewMediator( context, uiEventLogger, sessionTracker, userTracker, falsingCollector, lockPatternUtils, broadcastDispatcher, statusBarKeyguardViewManagerLazy, dismissCallbackRegistry, updateMonitor, dumpManager, uiBgExecutor, powerManager, trustManager, userSwitcherController, deviceConfig, navigationModeController, keyguardDisplayManager, dozeParameters, statusBarStateController, keyguardStateController, keyguardUnlockAnimationController, screenOffAnimationController, notificationShadeDepthController, screenOnCoordinator, keyguardTransitions, interactionJankMonitor, dreamOverlayStateController, javaAdapter, wallpaperRepository, shadeController, notificationShadeWindowController, activityTransitionAnimator, scrimControllerLazy, activityTaskManagerService, featureFlags, secureSettings, systemSettings, systemClock, mainDispatcher, dreamViewModel, communalTransitionViewModel, systemPropertiesHelper, wmLockscreenVisibilityManager, selectedUserInteractor, keyguardInteractor, wmOcclusionManager); } /** */ @Provides static ViewMediatorCallback providesViewMediatorCallback(KeyguardViewMediator viewMediator) { return viewMediator.getViewMediatorCallback(); } /** Binds {@link KeyguardUpdateMonitor} as a {@link CoreStartable}. */ @Binds @IntoMap @ClassKey(KeyguardUpdateMonitor.class) CoreStartable bindsKeyguardUpdateMonitor(KeyguardUpdateMonitor keyguardUpdateMonitor); }