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.keyguard.LockIconViewController; 22 import com.android.systemui.biometrics.AuthRippleController; 23 import com.android.systemui.statusbar.phone.NotificationPanelViewController; 24 import com.android.systemui.statusbar.phone.NotificationShadeWindowView; 25 import com.android.systemui.statusbar.phone.NotificationShadeWindowViewController; 26 import com.android.systemui.statusbar.phone.StatusBarWindowController; 27 28 import java.lang.annotation.Documented; 29 import java.lang.annotation.Retention; 30 31 import javax.inject.Scope; 32 33 import dagger.BindsInstance; 34 import dagger.Subcomponent; 35 36 /** 37 * Dagger subcomponent tied to the lifecycle of StatusBar views. 38 */ 39 @Subcomponent(modules = {StatusBarViewModule.class}) 40 @StatusBarComponent.StatusBarScope 41 public interface StatusBarComponent { 42 /** 43 * Builder for {@link StatusBarComponent}. 44 */ 45 @Subcomponent.Builder 46 interface Builder { statusBarWindowView( NotificationShadeWindowView notificationShadeWindowView)47 @BindsInstance Builder statusBarWindowView( 48 NotificationShadeWindowView notificationShadeWindowView); build()49 StatusBarComponent build(); 50 } 51 52 /** 53 * Scope annotation for singleton items within the StatusBarComponent. 54 */ 55 @Documented 56 @Retention(RUNTIME) 57 @Scope 58 @interface StatusBarScope {} 59 60 /** 61 * Creates a NotificationShadeWindowViewController. 62 */ 63 @StatusBarScope getNotificationShadeWindowViewController()64 NotificationShadeWindowViewController getNotificationShadeWindowViewController(); 65 66 /** 67 * Creates a StatusBarWindowViewController. 68 */ 69 @StatusBarScope getStatusBarWindowController()70 StatusBarWindowController getStatusBarWindowController(); 71 72 /** 73 * Creates a NotificationPanelViewController. 74 */ 75 @StatusBarScope getNotificationPanelViewController()76 NotificationPanelViewController getNotificationPanelViewController(); 77 78 /** 79 * Creates a LockIconViewController. Must be init after creation. 80 */ 81 @StatusBarScope getLockIconViewController()82 LockIconViewController getLockIconViewController(); 83 84 /** 85 * Creates an AuthRippleViewController. Must be init after creation. 86 */ 87 @StatusBarScope getAuthRippleController()88 AuthRippleController getAuthRippleController(); 89 } 90