From 9d058cc08416fc125810a00c3a3e7e1c7048a24f Mon Sep 17 00:00:00 2001 From: Jeff DeCew Date: Mon, 10 Jan 2022 17:57:04 +0000 Subject: [PATCH] Start using @AssistedFactory in Notifications Test: gradle build Change-Id: I7b818f3a8a1d2fae73348b332c000f28a168aa6b --- .../collection/render/ShadeViewManager.kt | 32 +++++++------------ 1 file changed, 12 insertions(+), 20 deletions(-) diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/render/ShadeViewManager.kt b/packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/render/ShadeViewManager.kt index 43a75a5d5da8f..ad973927f21e4 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/render/ShadeViewManager.kt +++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/render/ShadeViewManager.kt @@ -24,16 +24,18 @@ import com.android.systemui.statusbar.notification.collection.ListEntry import com.android.systemui.statusbar.notification.collection.NotificationEntry import com.android.systemui.statusbar.notification.stack.NotificationListContainer import com.android.systemui.util.traceSection -import javax.inject.Inject +import dagger.assisted.Assisted +import dagger.assisted.AssistedFactory +import dagger.assisted.AssistedInject /** * Responsible for building and applying the "shade node spec": the list (tree) of things that * currently populate the notification shade. */ -class ShadeViewManager constructor( +class ShadeViewManager @AssistedInject constructor( context: Context, - listContainer: NotificationListContainer, - private val stackController: NotifStackController, + @Assisted listContainer: NotificationListContainer, + @Assisted private val stackController: NotifStackController, mediaContainerController: MediaContainerController, featureManager: NotificationSectionsFeatureManager, logger: ShadeViewDifferLogger, @@ -68,20 +70,10 @@ class ShadeViewManager constructor( } } -class ShadeViewManagerFactory @Inject constructor( - private val context: Context, - private val logger: ShadeViewDifferLogger, - private val mediaContainerController: MediaContainerController, - private val sectionsFeatureManager: NotificationSectionsFeatureManager, - private val viewBarn: NotifViewBarn -) { - fun create(listContainer: NotificationListContainer, stackController: NotifStackController) = - ShadeViewManager( - context, - listContainer, - stackController, - mediaContainerController, - sectionsFeatureManager, - logger, - viewBarn) +@AssistedFactory +interface ShadeViewManagerFactory { + fun create( + listContainer: NotificationListContainer, + stackController: NotifStackController + ): ShadeViewManager }