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.statusbar.phone.dagger; 18 19 import static java.lang.annotation.RetentionPolicy.RUNTIME; 20 21 import com.android.systemui.statusbar.phone.NotificationPanelViewController; 22 import com.android.systemui.statusbar.phone.NotificationShadeWindowView; 23 import com.android.systemui.statusbar.phone.NotificationShadeWindowViewController; 24 import com.android.systemui.statusbar.phone.StatusBarWindowController; 25 26 import java.lang.annotation.Documented; 27 import java.lang.annotation.Retention; 28 29 import javax.inject.Scope; 30 31 import dagger.BindsInstance; 32 import dagger.Subcomponent; 33 34 /** 35 * Dagger subcomponent tied to the lifecycle of StatusBar views. 36 */ 37 @Subcomponent(modules = {StatusBarViewModule.class}) 38 @StatusBarComponent.StatusBarScope 39 public interface StatusBarComponent { 40 /** 41 * Builder for {@link StatusBarComponent}. 42 */ 43 @Subcomponent.Builder 44 interface Builder { statusBarWindowView( NotificationShadeWindowView notificationShadeWindowView)45 @BindsInstance Builder statusBarWindowView( 46 NotificationShadeWindowView notificationShadeWindowView); build()47 StatusBarComponent build(); 48 } 49 50 /** 51 * Scope annotation for singleton items within the StatusBarComponent. 52 */ 53 @Documented 54 @Retention(RUNTIME) 55 @Scope 56 @interface StatusBarScope {} 57 58 /** 59 * Creates a NotificationShadeWindowViewController. 60 */ 61 @StatusBarScope getNotificationShadeWindowViewController()62 NotificationShadeWindowViewController getNotificationShadeWindowViewController(); 63 64 /** 65 * Creates a StatusBarWindowViewController. 66 */ 67 @StatusBarScope getStatusBarWindowController()68 StatusBarWindowController getStatusBarWindowController(); 69 70 /** 71 * Creates a NotificationPanelViewController. 72 */ 73 @StatusBarScope getNotificationPanelViewController()74 NotificationPanelViewController getNotificationPanelViewController(); 75 76 } 77