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.keyguard.dagger;
18 
19 import android.app.trust.TrustManager;
20 import android.content.Context;
21 import android.os.PowerManager;
22 
23 import com.android.internal.widget.LockPatternUtils;
24 import com.android.keyguard.KeyguardUpdateMonitor;
25 import com.android.keyguard.KeyguardViewController;
26 import com.android.systemui.broadcast.BroadcastDispatcher;
27 import com.android.systemui.dagger.qualifiers.UiBackground;
28 import com.android.systemui.dump.DumpManager;
29 import com.android.systemui.keyguard.DismissCallbackRegistry;
30 import com.android.systemui.keyguard.KeyguardViewMediator;
31 import com.android.systemui.plugins.FalsingManager;
32 import com.android.systemui.statusbar.phone.NavigationModeController;
33 import com.android.systemui.statusbar.phone.StatusBar;
34 import com.android.systemui.util.DeviceConfigProxy;
35 
36 import java.util.concurrent.Executor;
37 
38 import javax.inject.Singleton;
39 
40 import dagger.Lazy;
41 import dagger.Module;
42 import dagger.Provides;
43 
44 /**
45  * Dagger Module providing {@link StatusBar}.
46  */
47 @Module
48 public class KeyguardModule {
49     /**
50      * Provides our instance of KeyguardViewMediator which is considered optional.
51      */
52     @Provides
53     @Singleton
newKeyguardViewMediator( Context context, FalsingManager falsingManager, LockPatternUtils lockPatternUtils, BroadcastDispatcher broadcastDispatcher, Lazy<KeyguardViewController> statusBarKeyguardViewManagerLazy, DismissCallbackRegistry dismissCallbackRegistry, KeyguardUpdateMonitor updateMonitor, DumpManager dumpManager, PowerManager powerManager, TrustManager trustManager, @UiBackground Executor uiBgExecutor, DeviceConfigProxy deviceConfig, NavigationModeController navigationModeController)54     public static KeyguardViewMediator newKeyguardViewMediator(
55             Context context,
56             FalsingManager falsingManager,
57             LockPatternUtils lockPatternUtils,
58             BroadcastDispatcher broadcastDispatcher,
59             Lazy<KeyguardViewController> statusBarKeyguardViewManagerLazy,
60             DismissCallbackRegistry dismissCallbackRegistry,
61             KeyguardUpdateMonitor updateMonitor,
62             DumpManager dumpManager,
63             PowerManager powerManager,
64             TrustManager trustManager,
65             @UiBackground Executor uiBgExecutor,
66             DeviceConfigProxy deviceConfig,
67             NavigationModeController navigationModeController) {
68         return new KeyguardViewMediator(
69                 context,
70                 falsingManager,
71                 lockPatternUtils,
72                 broadcastDispatcher,
73                 statusBarKeyguardViewManagerLazy,
74                 dismissCallbackRegistry,
75                 updateMonitor,
76                 dumpManager,
77                 uiBgExecutor,
78                 powerManager,
79                 trustManager,
80                 deviceConfig,
81                 navigationModeController);
82     }
83 }
84