blob: 9a063aa7b791e3b44c52a1a6bdfd4befa52188de [file] [log] [blame]
Govinda Wasserman8d49d0d2019-08-22 16:51:48 -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;
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.NotificationEntryManager;
33import com.android.systemui.statusbar.notification.NotificationInterruptionStateProvider;
34import com.android.systemui.statusbar.notification.collection.NotificationData;
35import com.android.systemui.statusbar.phone.KeyguardEnvironmentImpl;
36import com.android.systemui.statusbar.phone.ShadeController;
37import com.android.systemui.statusbar.phone.StatusBar;
38
39import javax.inject.Named;
40import javax.inject.Singleton;
41
42import dagger.Binds;
43import dagger.Module;
44import dagger.Provides;
45
46@Module
47abstract class CarSystemUIModule {
48
49 @Binds
50 abstract NotificationInterruptionStateProvider bindNotificationInterruptionStateProvider(
51 CarNotificationInterruptionStateProvider notificationInterruptionStateProvider);
52
53 @Singleton
54 @Provides
55 @Named(ALLOW_NOTIFICATION_LONG_PRESS_NAME)
56 static boolean provideAllowNotificationLongPress() {
57 return false;
58 }
59
60 /**
61 * Use {@link CarNotificationEntryManager}, which does nothing when adding a notification.
62 */
63 @Binds
64 abstract NotificationEntryManager bindNotificationEntryManager(
65 CarNotificationEntryManager notificationEntryManager);
66
67 @Singleton
68 @Provides
69 @Named(LEAK_REPORT_EMAIL_NAME)
70 static String provideLeakReportEmail() {
71 return "buganizer-system+181579@google.com";
72 }
73
74 @Binds
75 abstract EnhancedEstimates bindEnhancedEstimates(EnhancedEstimatesImpl enhancedEstimates);
76
77 @Binds
78 abstract NotificationLockscreenUserManager bindNotificationLockscreenUserManager(
79 NotificationLockscreenUserManagerImpl notificationLockscreenUserManager);
80
81 @Binds
82 abstract DockManager bindDockManager(DockManagerImpl dockManager);
83
84 @Binds
85 abstract NotificationData.KeyguardEnvironment bindKeyguardEnvironment(
86 KeyguardEnvironmentImpl keyguardEnvironment);
87
88 @Singleton
89 @Provides
90 static ShadeController provideShadeController(Context context) {
91 return SysUiServiceProvider.getComponent(context, StatusBar.class);
92 }
93
94 @Binds
95 abstract SystemUIRootComponent bindSystemUIRootComponent(
96 CarSystemUIRootComponent systemUIRootComponent);
97}