From 533fa15164f7bfab1d7f13fdda7dc879cfd3ef1f Mon Sep 17 00:00:00 2001 From: Jeff DeCew Date: Fri, 19 Nov 2021 15:50:59 +0000 Subject: [PATCH] Remove some instances of using NEM Test: Manual w/ new pipeline Change-Id: I8827349070d8650262e392f73343b2fa8bf1d41a --- .../init/NotificationsControllerImpl.kt | 21 +++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/init/NotificationsControllerImpl.kt b/packages/SystemUI/src/com/android/systemui/statusbar/notification/init/NotificationsControllerImpl.kt index 9411de75ba7f6..999ef9c99dd22 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/init/NotificationsControllerImpl.kt +++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/init/NotificationsControllerImpl.kt @@ -47,7 +47,7 @@ import com.android.wm.shell.bubbles.Bubbles import dagger.Lazy import java.io.FileDescriptor import java.io.PrintWriter -import java.util.* +import java.util.Optional import javax.inject.Inject /** @@ -152,8 +152,14 @@ class NotificationsControllerImpl @Inject constructor( } override fun resetUserExpandedStates() { - for (entry in entryManager.visibleNotifications) { - entry.resetUserExpansion() + if (notifPipelineFlags.isNewPipelineEnabled()) { + for (entry in notifPipeline.get().allNotifs) { + entry.resetUserExpansion() + } + } else { + for (entry in entryManager.visibleNotifications) { + entry.resetUserExpansion() + } } } @@ -167,9 +173,12 @@ class NotificationsControllerImpl @Inject constructor( } } - override fun getActiveNotificationsCount(): Int { - return entryManager.activeNotificationsCount - } + override fun getActiveNotificationsCount(): Int = + if (notifPipelineFlags.isNewPipelineEnabled()) { + notifPipeline.get().getShadeListCount() + } else { + entryManager.activeNotificationsCount + } companion object { // NOTE: The new pipeline is always active, even if the old pipeline is *rendering*.