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 
21 import com.android.systemui.fragments.FragmentService;
22 import com.android.systemui.statusbar.phone.StatusBar;
23 import com.android.systemui.statusbar.policy.ConfigurationController;
24 import com.android.systemui.util.InjectionInflationController;
25 import com.android.systemui.util.leak.GarbageMonitor;
26 
27 import javax.inject.Named;
28 import javax.inject.Singleton;
29 
30 import dagger.Component;
31 
32 /**
33  * Root component for Dagger injection.
34  */
35 @Singleton
36 @Component(modules = {
37         DependencyProvider.class,
38         DependencyBinder.class,
39         ServiceBinder.class,
40         SystemUIFactory.ContextHolder.class,
41         SystemUIModule.class,
42         SystemUIDefaultModule.class})
43 public interface SystemUIRootComponent {
44 
45     /**
46      * Main dependency providing module.
47      */
48     @Singleton
createDependency()49     Dependency.DependencyInjector createDependency();
50 
51 
52     /**
53      * Creates a ConfigurationController.
54      */
55     @Singleton
getConfigurationController()56     ConfigurationController getConfigurationController();
57 
58     /**
59      * Injects the StatusBar.
60      */
61     @Singleton
getStatusBarInjector()62     StatusBar.StatusBarInjector getStatusBarInjector();
63 
64     /**
65      * FragmentCreator generates all Fragments that need injection.
66      */
67     @Singleton
createFragmentCreator()68     FragmentService.FragmentCreator createFragmentCreator();
69 
70     /**
71      * ViewCreator generates all Views that need injection.
72      */
createViewCreator()73     InjectionInflationController.ViewCreator createViewCreator();
74 
75     /**
76      * Creatse a GarbageMonitor.
77      */
78     @Singleton
createGarbageMonitor()79     GarbageMonitor createGarbageMonitor();
80 
81     /**
82      * Whether notification long press is allowed.
83      */
84     @Named(ALLOW_NOTIFICATION_LONG_PRESS_NAME)
allowNotificationLongPressName()85     boolean allowNotificationLongPressName();
86 
87     /**
88      * Injects into the supplied argument.
89      */
inject(SystemUIAppComponentFactory factory)90     void inject(SystemUIAppComponentFactory factory);
91 }
92