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