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 
21 import com.android.systemui.dagger.qualifiers.InstrumentationTest;
22 import com.android.systemui.util.InitializationChecker;
23 
24 import dagger.BindsInstance;
25 
26 /**
27  * Base root component for Dagger injection.
28  *
29  * This class is not actually annotated as a Dagger component, since it is not used directly as one.
30  * Doing so generates unnecessary code bloat.
31  *
32  * See {@link ReferenceGlobalRootComponent} for the one actually used by AOSP.
33  */
34 public interface GlobalRootComponent {
35 
36     /**
37      * Builder for a GlobalRootComponent.
38      */
39     interface Builder {
40         @BindsInstance
context(Context context)41         Builder context(Context context);
42         @BindsInstance
instrumentationTest(@nstrumentationTest boolean test)43         Builder instrumentationTest(@InstrumentationTest boolean test);
build()44         GlobalRootComponent build();
45     }
46 
47     /**
48      * Builder for a {@link WMComponent}, which makes it a subcomponent of this class.
49      */
getWMComponentBuilder()50     WMComponent.Builder getWMComponentBuilder();
51 
52     /**
53      * Builder for a {@link ReferenceSysUIComponent}, which makes it a subcomponent of this class.
54      */
getSysUIComponent()55     SysUIComponent.Builder getSysUIComponent();
56 
57     /**
58      * Returns an {@link InitializationChecker}.
59      */
getInitializationChecker()60     InitializationChecker getInitializationChecker();
61 }
62