blob: 262b5ec50d838b3b7cd7278c6fa937d9d2dfb83d [file] [log] [blame]
Govinda Wasserman3e7ce552019-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
Govinda Wasserman8d49d0d2019-08-22 16:51:48 -040019import static com.android.systemui.Dependency.ALLOW_NOTIFICATION_LONG_PRESS_NAME;
Govinda Wasserman3e7ce552019-08-13 11:35:44 -040020import static com.android.systemui.Dependency.LEAK_REPORT_EMAIL_NAME;
21
22import android.content.Context;
23
24import androidx.annotation.Nullable;
25
26import com.android.systemui.dock.DockManager;
27import com.android.systemui.dock.DockManagerImpl;
28import com.android.systemui.power.EnhancedEstimates;
29import com.android.systemui.power.EnhancedEstimatesImpl;
30import com.android.systemui.statusbar.NotificationLockscreenUserManager;
31import com.android.systemui.statusbar.NotificationLockscreenUserManagerImpl;
32import com.android.systemui.statusbar.notification.collection.NotificationData;
33import com.android.systemui.statusbar.phone.KeyguardEnvironmentImpl;
34import com.android.systemui.statusbar.phone.ShadeController;
35import com.android.systemui.statusbar.phone.StatusBar;
36
37import javax.inject.Named;
38import javax.inject.Singleton;
39
40import dagger.Binds;
41import dagger.Module;
42import dagger.Provides;
43
44/**
45 * A dagger module for injecting default implementations of components of System UI that may be
46 * overridden by the System UI implementation.
47 */
48@Module
49abstract class SystemUIDefaultModule {
50
51 @Singleton
52 @Provides
53 @Named(LEAK_REPORT_EMAIL_NAME)
54 @Nullable
55 static String provideLeakReportEmail() {
56 return null;
57 }
58
59 @Binds
60 abstract EnhancedEstimates bindEnhancedEstimates(EnhancedEstimatesImpl enhancedEstimates);
61
62 @Binds
63 abstract NotificationLockscreenUserManager bindNotificationLockscreenUserManager(
64 NotificationLockscreenUserManagerImpl notificationLockscreenUserManager);
65
66 @Binds
67 abstract DockManager bindDockManager(DockManagerImpl dockManager);
68
69 @Binds
70 abstract NotificationData.KeyguardEnvironment bindKeyguardEnvironment(
71 KeyguardEnvironmentImpl keyguardEnvironment);
72
73 @Singleton
74 @Provides
75 static ShadeController provideShadeController(Context context) {
76 return SysUiServiceProvider.getComponent(context, StatusBar.class);
77 }
Govinda Wasserman8d49d0d2019-08-22 16:51:48 -040078
79 @Singleton
80 @Provides
81 @Named(ALLOW_NOTIFICATION_LONG_PRESS_NAME)
82 static boolean provideAllowNotificationLongPress() {
83 return true;
84 }
Govinda Wasserman3e7ce552019-08-13 11:35:44 -040085}