Govinda Wasserman | 2e86fb6 | 2019-08-13 11:35:44 -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 | |
Dave Mankoff | f473681 | 2019-10-18 17:25:50 -0400 | [diff] [blame^] | 17 | package com.android.systemui.dagger; |
Govinda Wasserman | 2e86fb6 | 2019-08-13 11:35:44 -0400 | [diff] [blame] | 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 | |
Govinda Wasserman | 2e86fb6 | 2019-08-13 11:35:44 -0400 | [diff] [blame] | 22 | import androidx.annotation.Nullable; |
| 23 | |
Dave Mankoff | f473681 | 2019-10-18 17:25:50 -0400 | [diff] [blame^] | 24 | import com.android.systemui.SystemUI; |
Govinda Wasserman | 2e86fb6 | 2019-08-13 11:35:44 -0400 | [diff] [blame] | 25 | import com.android.systemui.dock.DockManager; |
| 26 | import com.android.systemui.dock.DockManagerImpl; |
| 27 | import com.android.systemui.power.EnhancedEstimates; |
| 28 | import com.android.systemui.power.EnhancedEstimatesImpl; |
| 29 | import com.android.systemui.statusbar.NotificationLockscreenUserManager; |
| 30 | import com.android.systemui.statusbar.NotificationLockscreenUserManagerImpl; |
| 31 | import com.android.systemui.statusbar.notification.collection.NotificationData; |
| 32 | import com.android.systemui.statusbar.phone.KeyguardEnvironmentImpl; |
| 33 | import com.android.systemui.statusbar.phone.ShadeController; |
| 34 | import com.android.systemui.statusbar.phone.StatusBar; |
| 35 | |
| 36 | import javax.inject.Named; |
| 37 | import javax.inject.Singleton; |
| 38 | |
| 39 | import dagger.Binds; |
| 40 | import dagger.Module; |
| 41 | import dagger.Provides; |
Dave Mankoff | bb9575f | 2019-10-02 12:23:49 -0400 | [diff] [blame] | 42 | import dagger.multibindings.ClassKey; |
| 43 | import dagger.multibindings.IntoMap; |
Govinda Wasserman | 2e86fb6 | 2019-08-13 11:35:44 -0400 | [diff] [blame] | 44 | |
| 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 |
| 50 | abstract 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 Mankoff | 0cf8dfc | 2019-09-27 12:46:41 -0400 | [diff] [blame] | 74 | @Binds |
| 75 | abstract ShadeController provideShadeController(StatusBar statusBar); |
Govinda Wasserman | 2e86fb6 | 2019-08-13 11:35:44 -0400 | [diff] [blame] | 76 | |
Dave Mankoff | bb9575f | 2019-10-02 12:23:49 -0400 | [diff] [blame] | 77 | @Binds |
| 78 | @IntoMap |
| 79 | @ClassKey(StatusBar.class) |
| 80 | public abstract SystemUI providesStatusBar(StatusBar statusBar); |
| 81 | |
Govinda Wasserman | 2e86fb6 | 2019-08-13 11:35:44 -0400 | [diff] [blame] | 82 | @Singleton |
| 83 | @Provides |
| 84 | @Named(ALLOW_NOTIFICATION_LONG_PRESS_NAME) |
| 85 | static boolean provideAllowNotificationLongPress() { |
| 86 | return true; |
| 87 | } |
| 88 | } |