• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2024 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.deviceentry
18 
19 import com.android.keyguard.EmptyLockIconViewController
20 import com.android.keyguard.LegacyLockIconViewController
21 import com.android.keyguard.LockIconViewController
22 import com.android.systemui.dagger.SysUISingleton
23 import com.android.systemui.deviceentry.data.repository.DeviceEntryRepositoryModule
24 import com.android.systemui.deviceentry.data.repository.FaceWakeUpTriggersConfigModule
25 import com.android.systemui.deviceentry.shared.DeviceEntryUdfpsRefactor
26 import com.android.systemui.keyguard.ui.transitions.DeviceEntryIconTransition
27 import dagger.Lazy
28 import dagger.Module
29 import dagger.Provides
30 import dagger.multibindings.Multibinds
31 
32 @Module(
33     includes =
34         [
35             DeviceEntryRepositoryModule::class,
36             FaceWakeUpTriggersConfigModule::class,
37         ],
38 )
39 abstract class DeviceEntryModule {
40     /**
41      * A set of DeviceEntryIconTransitions. Ensures that this can be injected even if it's empty.
42      */
deviceEntryIconTransitionSetnull43     @Multibinds abstract fun deviceEntryIconTransitionSet(): Set<DeviceEntryIconTransition>
44 
45     companion object {
46         @Provides
47         @SysUISingleton
48         fun provideLockIconViewController(
49             legacyLockIconViewController: Lazy<LegacyLockIconViewController>,
50             emptyLockIconViewController: Lazy<EmptyLockIconViewController>,
51         ): LockIconViewController {
52             return if (DeviceEntryUdfpsRefactor.isEnabled) {
53                 emptyLockIconViewController.get()
54             } else {
55                 legacyLockIconViewController.get()
56             }
57         }
58     }
59 }
60