Govinda Wasserman | 8d49d0d | 2019-08-22 16:51:48 -0400 | [diff] [blame] | 1 | /* |
| 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 | |
| 17 | package com.android.systemui; |
| 18 | |
| 19 | import static com.android.systemui.Dependency.ALLOW_NOTIFICATION_LONG_PRESS_NAME; |
| 20 | import static com.android.systemui.Dependency.LEAK_REPORT_EMAIL_NAME; |
| 21 | |
| 22 | import android.content.Context; |
| 23 | |
| 24 | import com.android.systemui.car.CarNotificationEntryManager; |
| 25 | import com.android.systemui.car.CarNotificationInterruptionStateProvider; |
| 26 | import com.android.systemui.dock.DockManager; |
| 27 | import com.android.systemui.dock.DockManagerImpl; |
| 28 | import com.android.systemui.power.EnhancedEstimates; |
| 29 | import com.android.systemui.power.EnhancedEstimatesImpl; |
| 30 | import com.android.systemui.statusbar.NotificationLockscreenUserManager; |
| 31 | import com.android.systemui.statusbar.NotificationLockscreenUserManagerImpl; |
| 32 | import com.android.systemui.statusbar.notification.NotificationEntryManager; |
| 33 | import com.android.systemui.statusbar.notification.NotificationInterruptionStateProvider; |
| 34 | import com.android.systemui.statusbar.notification.collection.NotificationData; |
| 35 | import com.android.systemui.statusbar.phone.KeyguardEnvironmentImpl; |
| 36 | import com.android.systemui.statusbar.phone.ShadeController; |
| 37 | import com.android.systemui.statusbar.phone.StatusBar; |
| 38 | |
| 39 | import javax.inject.Named; |
| 40 | import javax.inject.Singleton; |
| 41 | |
| 42 | import dagger.Binds; |
| 43 | import dagger.Module; |
| 44 | import dagger.Provides; |
| 45 | |
| 46 | @Module |
| 47 | abstract 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 | } |