Loading packages/SystemUI/src/com/android/systemui/statusbar/notification/NotificationEntryManager.java +8 −0 Original line number Diff line number Diff line Loading @@ -791,6 +791,7 @@ public class NotificationEntryManager implements * these don't exist, although there are a couple exceptions. */ public Iterable<NotificationEntry> getPendingNotificationsIterator() { mNotifPipelineFlags.checkLegacyPipelineEnabled(); return mPendingNotifications.values(); } Loading @@ -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); } Loading @@ -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; Loading Loading @@ -945,6 +948,7 @@ public class NotificationEntryManager implements * @return A read-only list of the currently active notifications */ public List<NotificationEntry> getVisibleNotifications() { mNotifPipelineFlags.checkLegacyPipelineEnabled(); return mReadOnlyNotifications; } Loading @@ -954,17 +958,20 @@ public class NotificationEntryManager implements */ @Override public Collection<NotificationEntry> 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(); } Loading @@ -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; } Loading packages/SystemUI/src/com/android/systemui/statusbar/notification/init/NotificationsControllerImpl.kt +15 −6 Original line number Diff line number Diff line Loading @@ -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 /** Loading Loading @@ -152,10 +152,16 @@ class NotificationsControllerImpl @Inject constructor( } override fun resetUserExpandedStates() { if (notifPipelineFlags.isNewPipelineEnabled()) { for (entry in notifPipeline.get().allNotifs) { entry.resetUserExpansion() } } else { for (entry in entryManager.visibleNotifications) { entry.resetUserExpansion() } } } override fun setNotificationSnoozed(sbn: StatusBarNotification, snoozeOption: SnoozeOption) { if (snoozeOption.snoozeCriterion != null) { Loading @@ -167,8 +173,11 @@ 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 { Loading Loading
packages/SystemUI/src/com/android/systemui/statusbar/notification/NotificationEntryManager.java +8 −0 Original line number Diff line number Diff line Loading @@ -791,6 +791,7 @@ public class NotificationEntryManager implements * these don't exist, although there are a couple exceptions. */ public Iterable<NotificationEntry> getPendingNotificationsIterator() { mNotifPipelineFlags.checkLegacyPipelineEnabled(); return mPendingNotifications.values(); } Loading @@ -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); } Loading @@ -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; Loading Loading @@ -945,6 +948,7 @@ public class NotificationEntryManager implements * @return A read-only list of the currently active notifications */ public List<NotificationEntry> getVisibleNotifications() { mNotifPipelineFlags.checkLegacyPipelineEnabled(); return mReadOnlyNotifications; } Loading @@ -954,17 +958,20 @@ public class NotificationEntryManager implements */ @Override public Collection<NotificationEntry> 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(); } Loading @@ -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; } Loading
packages/SystemUI/src/com/android/systemui/statusbar/notification/init/NotificationsControllerImpl.kt +15 −6 Original line number Diff line number Diff line Loading @@ -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 /** Loading Loading @@ -152,10 +152,16 @@ class NotificationsControllerImpl @Inject constructor( } override fun resetUserExpandedStates() { if (notifPipelineFlags.isNewPipelineEnabled()) { for (entry in notifPipeline.get().allNotifs) { entry.resetUserExpansion() } } else { for (entry in entryManager.visibleNotifications) { entry.resetUserExpansion() } } } override fun setNotificationSnoozed(sbn: StatusBarNotification, snoozeOption: SnoozeOption) { if (snoozeOption.snoozeCriterion != null) { Loading @@ -167,8 +173,11 @@ 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 { Loading