blob: 0f44e0815a8636de8b4844d01895f9aa3d418f15 [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 static com.android.systemui.Dependency.ALLOW_NOTIFICATION_LONG_PRESS_NAME;
20import static com.android.systemui.Dependency.LEAK_REPORT_EMAIL_NAME;
21
22import android.content.Context;
23
24import com.android.systemui.car.CarNotificationEntryManager;
25import com.android.systemui.car.CarNotificationInterruptionStateProvider;
Dave Mankofff4736812019-10-18 17:25:50 -040026import com.android.systemui.dagger.SystemUIRootComponent;
Govinda Wasserman2e86fb62019-08-13 11:35:44 -040027import com.android.systemui.dock.DockManager;
28import com.android.systemui.dock.DockManagerImpl;
29import com.android.systemui.power.EnhancedEstimates;
30import com.android.systemui.power.EnhancedEstimatesImpl;
31import com.android.systemui.statusbar.NotificationLockscreenUserManager;
32import com.android.systemui.statusbar.NotificationLockscreenUserManagerImpl;
Dave Mankoffbb9575f2019-10-02 12:23:49 -040033import com.android.systemui.statusbar.car.CarStatusBar;
Govinda Wasserman2e86fb62019-08-13 11:35:44 -040034import com.android.systemui.statusbar.notification.NotificationEntryManager;
35import com.android.systemui.statusbar.notification.NotificationInterruptionStateProvider;
36import com.android.systemui.statusbar.notification.collection.NotificationData;
37import com.android.systemui.statusbar.phone.KeyguardEnvironmentImpl;
38import com.android.systemui.statusbar.phone.ShadeController;
39import com.android.systemui.statusbar.phone.StatusBar;
Dave Mankoff33174bc2019-10-10 14:57:02 -040040import com.android.systemui.volume.CarVolumeDialogComponent;
41import com.android.systemui.volume.VolumeDialogComponent;
Govinda Wasserman2e86fb62019-08-13 11:35:44 -040042
43import javax.inject.Named;
44import javax.inject.Singleton;
45
46import dagger.Binds;
47import dagger.Module;
48import dagger.Provides;
Dave Mankoffbb9575f2019-10-02 12:23:49 -040049import dagger.multibindings.ClassKey;
50import dagger.multibindings.IntoMap;
Govinda Wasserman2e86fb62019-08-13 11:35:44 -040051
52@Module
53abstract class CarSystemUIModule {
54
55 @Binds
56 abstract NotificationInterruptionStateProvider bindNotificationInterruptionStateProvider(
57 CarNotificationInterruptionStateProvider notificationInterruptionStateProvider);
58
59 @Singleton
60 @Provides
61 @Named(ALLOW_NOTIFICATION_LONG_PRESS_NAME)
62 static boolean provideAllowNotificationLongPress() {
63 return false;
64 }
65
66 /**
67 * Use {@link CarNotificationEntryManager}, which does nothing when adding a notification.
68 */
69 @Binds
70 abstract NotificationEntryManager bindNotificationEntryManager(
71 CarNotificationEntryManager notificationEntryManager);
72
73 @Singleton
74 @Provides
75 @Named(LEAK_REPORT_EMAIL_NAME)
76 static String provideLeakReportEmail() {
77 return "buganizer-system+181579@google.com";
78 }
79
80 @Binds
81 abstract EnhancedEstimates bindEnhancedEstimates(EnhancedEstimatesImpl enhancedEstimates);
82
83 @Binds
84 abstract NotificationLockscreenUserManager bindNotificationLockscreenUserManager(
85 NotificationLockscreenUserManagerImpl notificationLockscreenUserManager);
86
87 @Binds
88 abstract DockManager bindDockManager(DockManagerImpl dockManager);
89
90 @Binds
91 abstract NotificationData.KeyguardEnvironment bindKeyguardEnvironment(
92 KeyguardEnvironmentImpl keyguardEnvironment);
93
94 @Singleton
95 @Provides
96 static ShadeController provideShadeController(Context context) {
97 return SysUiServiceProvider.getComponent(context, StatusBar.class);
98 }
99
100 @Binds
101 abstract SystemUIRootComponent bindSystemUIRootComponent(
102 CarSystemUIRootComponent systemUIRootComponent);
Dave Mankoffbb9575f2019-10-02 12:23:49 -0400103
104 @Binds
105 @IntoMap
106 @ClassKey(StatusBar.class)
107 public abstract SystemUI providesStatusBar(CarStatusBar statusBar);
Dave Mankoff33174bc2019-10-10 14:57:02 -0400108
109 @Binds
110 abstract VolumeDialogComponent bindVolumeDialogComponent(
111 CarVolumeDialogComponent carVolumeDialogComponent);
Govinda Wasserman2e86fb62019-08-13 11:35:44 -0400112}