blob: edd2463984c8ff582d799fc19a346b711a60a744 [file] [log] [blame]
Govinda Wasserman2e86fb62019-08-13 11:35:44 -04001/*
2 * Copyright (C) 2019 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
17package com.android.systemui;
18
19import android.annotation.Nullable;
20import android.content.Context;
21import android.content.pm.PackageManager;
22
23import com.android.systemui.plugins.statusbar.StatusBarStateController;
24import com.android.systemui.statusbar.phone.KeyguardLiftController;
25import com.android.systemui.util.AsyncSensorManager;
26
27import javax.inject.Singleton;
28
29import dagger.Module;
30import dagger.Provides;
31
32/**
33 * A dagger module for injecting components of System UI that are not overridden by the System UI
34 * implementation.
35 */
36@Module
37public abstract class SystemUIModule {
38
39 @Singleton
40 @Provides
41 @Nullable
42 static KeyguardLiftController provideKeyguardLiftController(Context context,
43 StatusBarStateController statusBarStateController,
44 AsyncSensorManager asyncSensorManager) {
45 if (!context.getPackageManager().hasSystemFeature(PackageManager.FEATURE_FACE)) {
46 return null;
47 }
48 return new KeyguardLiftController(context, statusBarStateController, asyncSensorManager);
49 }
50}