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 android.content.Context;
20 import android.os.Looper;
21 
22 import com.android.systemui.dagger.qualifiers.InstrumentationTest;
23 import com.android.systemui.dagger.qualifiers.Main;
24 import com.android.systemui.flags.SystemPropertiesHelper;
25 import com.android.systemui.process.ProcessWrapper;
26 import com.android.systemui.util.InitializationChecker;
27 
28 import dagger.BindsInstance;
29 
30 /**
31  * Base root component for Dagger injection.
32  *
33  * This class is not actually annotated as a Dagger component, since it is not used directly as one.
34  * Doing so generates unnecessary code bloat.
35  *
36  * See {@link ReferenceGlobalRootComponent} for the one actually used by AOSP.
37  */
38 public interface GlobalRootComponent {
39 
40     /**
41      * Builder for a GlobalRootComponent.
42      */
43     interface Builder {
44         @BindsInstance
context(Context context)45         Builder context(Context context);
46         @BindsInstance
instrumentationTest(@nstrumentationTest boolean test)47         Builder instrumentationTest(@InstrumentationTest boolean test);
build()48         GlobalRootComponent build();
49     }
50 
51     /**
52      * Builder for a {@link WMComponent}, which makes it a subcomponent of this class.
53      */
getWMComponentBuilder()54     WMComponent.Builder getWMComponentBuilder();
55 
56     /**
57      * Builder for a {@link ReferenceSysUIComponent}, which makes it a subcomponent of this class.
58      */
getSysUIComponent()59     SysUIComponent.Builder getSysUIComponent();
60 
61     /**
62      * Returns an {@link InitializationChecker}.
63      */
getInitializationChecker()64     InitializationChecker getInitializationChecker();
65 
66     /**
67      * Returns the main looper for this process.
68      */
69     @Main
getMainLooper()70     Looper getMainLooper();
71 
72     /**
73      * Returns a {@link SystemPropertiesHelper}.
74      */
getSystemPropertiesHelper()75     SystemPropertiesHelper getSystemPropertiesHelper();
76 
77     /**
78      * Returns a {@link ProcessWrapper}
79      */
getProcessWrapper()80     ProcessWrapper getProcessWrapper();
81 }
82