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