[Central Surfaces] Make NotificationPanelView a singleton.

Bug: 277762009
Test: compiles; shade works
Change-Id: I69cadfeb95892105784fcf4718a3ba9b5e13298f
This commit is contained in:
Caitlin Shkuratov
2023-04-17 15:30:25 +00:00
parent 8816c72a14
commit 022c490d56
3 changed files with 9 additions and 12 deletions

View File

@@ -84,10 +84,6 @@ public class NotificationShadeWindowView extends FrameLayout {
setMotionEventSplittingEnabled(false);
}
public NotificationPanelView getNotificationPanelView() {
return findViewById(R.id.notification_panel);
}
@Override
public WindowInsets onApplyWindowInsets(WindowInsets windowInsets) {
final Insets insets = windowInsets.getInsetsIgnoringVisibility(systemBars());

View File

@@ -50,5 +50,14 @@ abstract class ShadeModule {
): NotificationStackScrollLayout {
return notificationShadeWindowView.findViewById(R.id.notification_stack_scroller)
}
// TODO(b/277762009): Only allow this view's controller to inject the view. See above.
@Provides
@SysUISingleton
fun providesNotificationPanelView(
notificationShadeWindowView: NotificationShadeWindowView,
): NotificationPanelView {
return notificationShadeWindowView.findViewById(R.id.notification_panel)
}
}
}

View File

@@ -134,14 +134,6 @@ public abstract class StatusBarViewModule {
}
}
/** */
@Provides
@CentralSurfacesComponent.CentralSurfacesScope
public static NotificationPanelView getNotificationPanelView(
NotificationShadeWindowView notificationShadeWindowView) {
return notificationShadeWindowView.getNotificationPanelView();
}
/** */
@Binds
@CentralSurfacesComponent.CentralSurfacesScope