1 /* 2 * Copyright 2023 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.scene 18 19 import android.view.View 20 import com.android.internal.jank.InteractionJankMonitor 21 import com.android.systemui.dagger.SysUISingleton 22 import com.android.systemui.keyguard.KeyguardViewConfigurator 23 import com.android.systemui.keyguard.domain.interactor.KeyguardClockInteractor 24 import com.android.systemui.keyguard.qualifiers.KeyguardRootView 25 import com.android.systemui.keyguard.shared.model.LockscreenSceneBlueprint 26 import com.android.systemui.keyguard.ui.composable.LockscreenContent 27 import com.android.systemui.keyguard.ui.composable.LockscreenScene 28 import com.android.systemui.keyguard.ui.composable.LockscreenSceneBlueprintModule 29 import com.android.systemui.keyguard.ui.composable.blueprint.ComposableLockscreenSceneBlueprint 30 import com.android.systemui.keyguard.ui.viewmodel.LockscreenContentViewModel 31 import com.android.systemui.scene.ui.composable.Scene 32 import com.android.systemui.statusbar.notification.stack.ui.viewmodel.NotificationLockscreenScrimViewModel 33 import dagger.Binds 34 import dagger.Module 35 import dagger.Provides 36 import dagger.multibindings.IntoSet 37 import javax.inject.Provider 38 39 @Module(includes = [LockscreenSceneBlueprintModule::class]) 40 interface LockscreenSceneModule { 41 lockscreenScenenull42 @Binds @IntoSet fun lockscreenScene(scene: LockscreenScene): Scene 43 44 companion object { 45 46 @Provides 47 @SysUISingleton 48 @KeyguardRootView 49 fun viewProvider(configurator: Provider<KeyguardViewConfigurator>): () -> View { 50 return { configurator.get().getKeyguardRootView() } 51 } 52 53 @Provides 54 fun providesLockscreenBlueprints( 55 blueprints: Set<@JvmSuppressWildcards ComposableLockscreenSceneBlueprint> 56 ): Set<LockscreenSceneBlueprint> { 57 return blueprints 58 } 59 60 @Provides 61 fun providesLockscreenContent( 62 viewModelFactory: LockscreenContentViewModel.Factory, 63 notificationScrimViewModelFactory: NotificationLockscreenScrimViewModel.Factory, 64 blueprints: Set<@JvmSuppressWildcards ComposableLockscreenSceneBlueprint>, 65 clockInteractor: KeyguardClockInteractor, 66 interactionJankMonitor: InteractionJankMonitor, 67 ): LockscreenContent { 68 return LockscreenContent( 69 viewModelFactory, 70 notificationScrimViewModelFactory, 71 blueprints, 72 clockInteractor, 73 interactionJankMonitor, 74 ) 75 } 76 } 77 } 78