From 073eacec43074753c44e5f2345deb72e64d82bcf Mon Sep 17 00:00:00 2001 From: Jeff DeCew Date: Fri, 19 Nov 2021 15:47:57 +0000 Subject: Make NEM spammy with new pipeline enabled. Test: run with the new pipeline Change-Id: Ide518edcf5c106df8c8dcba4016b910ee2a787fe --- .../systemui/statusbar/notification/NotificationEntryManager.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/NotificationEntryManager.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/NotificationEntryManager.java index e78b4f43f00a..0389a7b01c72 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/NotificationEntryManager.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/NotificationEntryManager.java @@ -791,6 +791,7 @@ public class NotificationEntryManager implements * these don't exist, although there are a couple exceptions. */ public Iterable getPendingNotificationsIterator() { + mNotifPipelineFlags.checkLegacyPipelineEnabled(); return mPendingNotifications.values(); } @@ -803,6 +804,7 @@ public class NotificationEntryManager implements * @return a {@link NotificationEntry} if it has been prepared, else null */ public NotificationEntry getActiveNotificationUnfiltered(String key) { + mNotifPipelineFlags.checkLegacyPipelineEnabled(); return mActiveNotifications.get(key); } @@ -811,6 +813,7 @@ public class NotificationEntryManager implements * notification doesn't exist. */ public NotificationEntry getPendingOrActiveNotif(String key) { + mNotifPipelineFlags.checkLegacyPipelineEnabled(); NotificationEntry entry = mPendingNotifications.get(key); if (entry != null) { return entry; @@ -945,6 +948,7 @@ public class NotificationEntryManager implements * @return A read-only list of the currently active notifications */ public List getVisibleNotifications() { + mNotifPipelineFlags.checkLegacyPipelineEnabled(); return mReadOnlyNotifications; } @@ -954,17 +958,20 @@ public class NotificationEntryManager implements */ @Override public Collection getAllNotifs() { + mNotifPipelineFlags.checkLegacyPipelineEnabled(); return mReadOnlyAllNotifications; } @Nullable @Override public NotificationEntry getEntry(String key) { + mNotifPipelineFlags.checkLegacyPipelineEnabled(); return getPendingOrActiveNotif(key); } /** @return A count of the active notifications */ public int getActiveNotificationsCount() { + mNotifPipelineFlags.checkLegacyPipelineEnabled(); return mReadOnlyNotifications.size(); } @@ -972,6 +979,7 @@ public class NotificationEntryManager implements * @return {@code true} if there is at least one notification that should be visible right now */ public boolean hasActiveNotifications() { + mNotifPipelineFlags.checkLegacyPipelineEnabled(); return mReadOnlyNotifications.size() != 0; } -- cgit v1.2.3-59-g8ed1b From 533fa15164f7bfab1d7f13fdda7dc879cfd3ef1f Mon Sep 17 00:00:00 2001 From: Jeff DeCew Date: Fri, 19 Nov 2021 15:50:59 +0000 Subject: 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 9411de75ba7f..999ef9c99dd2 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*. -- cgit v1.2.3-59-g8ed1b