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.dagger;
18 
19 import static com.android.systemui.Dependency.ALLOW_NOTIFICATION_LONG_PRESS_NAME;
20 
21 import android.content.ContentProvider;
22 
23 import com.android.systemui.BootCompleteCacheImpl;
24 import com.android.systemui.Dependency;
25 import com.android.systemui.InitController;
26 import com.android.systemui.SystemUIAppComponentFactory;
27 import com.android.systemui.SystemUIFactory;
28 import com.android.systemui.dump.DumpManager;
29 import com.android.systemui.fragments.FragmentService;
30 import com.android.systemui.keyguard.KeyguardSliceProvider;
31 import com.android.systemui.pip.phone.dagger.PipModule;
32 import com.android.systemui.statusbar.policy.ConfigurationController;
33 import com.android.systemui.util.InjectionInflationController;
34 
35 import javax.inject.Named;
36 import javax.inject.Singleton;
37 
38 import dagger.Component;
39 
40 /**
41  * Root component for Dagger injection.
42  */
43 @Singleton
44 @Component(modules = {
45         DefaultComponentBinder.class,
46         DependencyProvider.class,
47         DependencyBinder.class,
48         PipModule.class,
49         SystemServicesModule.class,
50         SystemUIFactory.ContextHolder.class,
51         SystemUIBinder.class,
52         SystemUIModule.class,
53         SystemUIDefaultModule.class})
54 public interface SystemUIRootComponent {
55 
56     /**
57      * Provides a BootCompleteCache.
58      */
59     @Singleton
provideBootCacheImpl()60     BootCompleteCacheImpl provideBootCacheImpl();
61 
62     /**
63      * Creates a ContextComponentHelper.
64      */
65     @Singleton
getConfigurationController()66     ConfigurationController getConfigurationController();
67 
68     /**
69      * Creates a ContextComponentHelper.
70      */
71     @Singleton
getContextComponentHelper()72     ContextComponentHelper getContextComponentHelper();
73 
74     /**
75      * Main dependency providing module.
76      */
77     @Singleton
createDependency()78     Dependency.DependencyInjector createDependency();
79 
80     /** */
81     @Singleton
createDumpManager()82     DumpManager createDumpManager();
83 
84     /**
85      * FragmentCreator generates all Fragments that need injection.
86      */
87     @Singleton
createFragmentCreator()88     FragmentService.FragmentCreator createFragmentCreator();
89 
90 
91     /**
92      * Creates a InitController.
93      */
94     @Singleton
getInitController()95     InitController getInitController();
96 
97     /**
98      * ViewCreator generates all Views that need injection.
99      */
createViewCreator()100     InjectionInflationController.ViewCreator createViewCreator();
101 
102     /**
103      * Whether notification long press is allowed.
104      */
105     @Named(ALLOW_NOTIFICATION_LONG_PRESS_NAME)
allowNotificationLongPressName()106     boolean allowNotificationLongPressName();
107 
108     /**
109      * Member injection into the supplied argument.
110      */
inject(SystemUIAppComponentFactory factory)111     void inject(SystemUIAppComponentFactory factory);
112 
113     /**
114      * Member injection into the supplied argument.
115      */
inject(ContentProvider contentProvider)116     void inject(ContentProvider contentProvider);
117 
118     /**
119      * Member injection into the supplied argument.
120      */
inject(KeyguardSliceProvider keyguardSliceProvider)121     void inject(KeyguardSliceProvider keyguardSliceProvider);
122 }
123