blob: c95b50b195b37133dfd6831ac6727f5209b19805 [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
Dave Mankofff4736812019-10-18 17:25:50 -040017package com.android.systemui.dagger;
Govinda Wasserman2e86fb62019-08-13 11:35:44 -040018
19import static com.android.systemui.Dependency.ALLOW_NOTIFICATION_LONG_PRESS_NAME;
20import static com.android.systemui.Dependency.LEAK_REPORT_EMAIL_NAME;
21
Govinda Wasserman2e86fb62019-08-13 11:35:44 -040022import androidx.annotation.Nullable;
23
Dave Mankofff4736812019-10-18 17:25:50 -040024import com.android.systemui.SystemUI;
Govinda Wasserman2e86fb62019-08-13 11:35:44 -040025import com.android.systemui.dock.DockManager;
26import com.android.systemui.dock.DockManagerImpl;
27import com.android.systemui.power.EnhancedEstimates;
28import com.android.systemui.power.EnhancedEstimatesImpl;
29import com.android.systemui.statusbar.NotificationLockscreenUserManager;
30import com.android.systemui.statusbar.NotificationLockscreenUserManagerImpl;
31import com.android.systemui.statusbar.notification.collection.NotificationData;
32import com.android.systemui.statusbar.phone.KeyguardEnvironmentImpl;
33import com.android.systemui.statusbar.phone.ShadeController;
34import com.android.systemui.statusbar.phone.StatusBar;
35
36import javax.inject.Named;
37import javax.inject.Singleton;
38
39import dagger.Binds;
40import dagger.Module;
41import dagger.Provides;
Dave Mankoffbb9575f2019-10-02 12:23:49 -040042import dagger.multibindings.ClassKey;
43import dagger.multibindings.IntoMap;
Govinda Wasserman2e86fb62019-08-13 11:35:44 -040044
45/**
46 * A dagger module for injecting default implementations of components of System UI that may be
47 * overridden by the System UI implementation.
48 */
49@Module
50abstract class SystemUIDefaultModule {
51
52 @Singleton
53 @Provides
54 @Named(LEAK_REPORT_EMAIL_NAME)
55 @Nullable
56 static String provideLeakReportEmail() {
57 return null;
58 }
59
60 @Binds
61 abstract EnhancedEstimates bindEnhancedEstimates(EnhancedEstimatesImpl enhancedEstimates);
62
63 @Binds
64 abstract NotificationLockscreenUserManager bindNotificationLockscreenUserManager(
65 NotificationLockscreenUserManagerImpl notificationLockscreenUserManager);
66
67 @Binds
68 abstract DockManager bindDockManager(DockManagerImpl dockManager);
69
70 @Binds
71 abstract NotificationData.KeyguardEnvironment bindKeyguardEnvironment(
72 KeyguardEnvironmentImpl keyguardEnvironment);
73
Dave Mankoff0cf8dfc2019-09-27 12:46:41 -040074 @Binds
75 abstract ShadeController provideShadeController(StatusBar statusBar);
Govinda Wasserman2e86fb62019-08-13 11:35:44 -040076
Dave Mankoffbb9575f2019-10-02 12:23:49 -040077 @Binds
78 @IntoMap
79 @ClassKey(StatusBar.class)
80 public abstract SystemUI providesStatusBar(StatusBar statusBar);
81
Govinda Wasserman2e86fb62019-08-13 11:35:44 -040082 @Singleton
83 @Provides
84 @Named(ALLOW_NOTIFICATION_LONG_PRESS_NAME)
85 static boolean provideAllowNotificationLongPress() {
86 return true;
87 }
88}