1 /*
2  * Copyright (C) 2022 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.navigationbar;
18 
19 import static java.lang.annotation.RetentionPolicy.RUNTIME;
20 
21 import android.content.Context;
22 import android.os.Bundle;
23 
24 import androidx.annotation.Nullable;
25 
26 import com.android.systemui.dagger.qualifiers.DisplayId;
27 
28 import dagger.BindsInstance;
29 import dagger.Subcomponent;
30 
31 import java.lang.annotation.Documented;
32 import java.lang.annotation.Retention;
33 
34 import javax.inject.Scope;
35 
36 /**
37  * Subcomponent for a NavigationBar.
38  *
39  * Generally creatd on a per-display basis.
40  */
41 @Subcomponent(modules = { NavigationBarModule.class })
42 @NavigationBarComponent.NavigationBarScope
43 public interface NavigationBarComponent {
44 
45     /** Factory for {@link NavigationBarComponent}. */
46     @Subcomponent.Factory
47     interface Factory {
create( @indsInstance @isplayId Context context, @BindsInstance @Nullable Bundle savedState)48         NavigationBarComponent create(
49                 @BindsInstance @DisplayId Context context,
50                 @BindsInstance @Nullable Bundle savedState);
51     }
52 
53     /** */
getNavigationBar()54     NavigationBar getNavigationBar();
55 
56     /**
57      * Scope annotation for singleton items within the NavigationBarComponent.
58      */
59     @Documented
60     @Retention(RUNTIME)
61     @Scope
62     @interface NavigationBarScope {}
63 }
64