Dave Mankoff | 2ea5a83 | 2019-07-03 13:26:55 -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 | |
Govinda Wasserman | 2e86fb6 | 2019-08-13 11:35:44 -0400 | [diff] [blame] | 19 | import static com.android.systemui.Dependency.ALLOW_NOTIFICATION_LONG_PRESS_NAME; |
| 20 | |
Hyunyoung Song | 8f9d34c | 2019-08-30 14:47:43 -0700 | [diff] [blame] | 21 | import android.content.ContentProvider; |
| 22 | |
Dave Mankoff | 2ea5a83 | 2019-07-03 13:26:55 -0400 | [diff] [blame] | 23 | import com.android.systemui.fragments.FragmentService; |
| 24 | import com.android.systemui.statusbar.phone.StatusBar; |
| 25 | import com.android.systemui.util.InjectionInflationController; |
| 26 | import com.android.systemui.util.leak.GarbageMonitor; |
| 27 | |
Govinda Wasserman | 2e86fb6 | 2019-08-13 11:35:44 -0400 | [diff] [blame] | 28 | import javax.inject.Named; |
Dave Mankoff | 2ea5a83 | 2019-07-03 13:26:55 -0400 | [diff] [blame] | 29 | import javax.inject.Singleton; |
| 30 | |
| 31 | import dagger.Component; |
| 32 | |
| 33 | /** |
| 34 | * Root component for Dagger injection. |
| 35 | */ |
| 36 | @Singleton |
Govinda Wasserman | 2e86fb6 | 2019-08-13 11:35:44 -0400 | [diff] [blame] | 37 | @Component(modules = { |
| 38 | DependencyProvider.class, |
| 39 | DependencyBinder.class, |
| 40 | ServiceBinder.class, |
Dave Mankoff | aa8b7ae | 2019-09-04 18:03:21 -0400 | [diff] [blame^] | 41 | SystemUIBinder.class, |
Govinda Wasserman | 2e86fb6 | 2019-08-13 11:35:44 -0400 | [diff] [blame] | 42 | SystemUIFactory.ContextHolder.class, |
| 43 | SystemUIModule.class, |
| 44 | SystemUIDefaultModule.class}) |
Dave Mankoff | 2ea5a83 | 2019-07-03 13:26:55 -0400 | [diff] [blame] | 45 | public interface SystemUIRootComponent { |
Dave Mankoff | aa8b7ae | 2019-09-04 18:03:21 -0400 | [diff] [blame^] | 46 | |
| 47 | /** |
| 48 | * Creates a GarbageMonitor. |
| 49 | */ |
| 50 | @Singleton |
| 51 | ContextComponentHelper getContextComponentHelper(); |
| 52 | |
Dave Mankoff | 2ea5a83 | 2019-07-03 13:26:55 -0400 | [diff] [blame] | 53 | /** |
| 54 | * Main dependency providing module. |
| 55 | */ |
| 56 | @Singleton |
| 57 | Dependency.DependencyInjector createDependency(); |
| 58 | |
| 59 | /** |
| 60 | * Injects the StatusBar. |
| 61 | */ |
| 62 | @Singleton |
| 63 | StatusBar.StatusBarInjector getStatusBarInjector(); |
| 64 | |
| 65 | /** |
| 66 | * FragmentCreator generates all Fragments that need injection. |
| 67 | */ |
| 68 | @Singleton |
| 69 | FragmentService.FragmentCreator createFragmentCreator(); |
| 70 | |
| 71 | /** |
| 72 | * ViewCreator generates all Views that need injection. |
| 73 | */ |
| 74 | InjectionInflationController.ViewCreator createViewCreator(); |
| 75 | |
| 76 | /** |
Dave Mankoff | aa8b7ae | 2019-09-04 18:03:21 -0400 | [diff] [blame^] | 77 | * Creates a GarbageMonitor. |
Dave Mankoff | 2ea5a83 | 2019-07-03 13:26:55 -0400 | [diff] [blame] | 78 | */ |
| 79 | @Singleton |
| 80 | GarbageMonitor createGarbageMonitor(); |
| 81 | |
| 82 | /** |
Govinda Wasserman | 2e86fb6 | 2019-08-13 11:35:44 -0400 | [diff] [blame] | 83 | * Whether notification long press is allowed. |
| 84 | */ |
| 85 | @Named(ALLOW_NOTIFICATION_LONG_PRESS_NAME) |
| 86 | boolean allowNotificationLongPressName(); |
| 87 | |
| 88 | /** |
Dave Mankoff | a4a7136 | 2019-08-27 14:40:05 -0400 | [diff] [blame] | 89 | * Member injection into the supplied argument. |
Dave Mankoff | 2ea5a83 | 2019-07-03 13:26:55 -0400 | [diff] [blame] | 90 | */ |
| 91 | void inject(SystemUIAppComponentFactory factory); |
Dave Mankoff | a4a7136 | 2019-08-27 14:40:05 -0400 | [diff] [blame] | 92 | |
| 93 | /** |
| 94 | * Member injection into the supplied argument. |
| 95 | */ |
| 96 | void inject(ContentProvider contentProvider); |
Dave Mankoff | 2ea5a83 | 2019-07-03 13:26:55 -0400 | [diff] [blame] | 97 | } |