Loading packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/notification/collection/BundleEntryAdapterTest.kt +5 −0 Original line number Diff line number Diff line Loading @@ -154,4 +154,9 @@ class BundleEntryAdapterTest : SysuiTestCase() { fun getPeopleNotificationType() { assertThat(underTest.getPeopleNotificationType()).isEqualTo(TYPE_NON_PERSON) } @Test fun getIcons() { assertThat(underTest.icons).isEqualTo(underTest.entry.icons) } } packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/BundleEntry.kt +3 −0 Original line number Diff line number Diff line Loading @@ -15,6 +15,7 @@ */ package com.android.systemui.statusbar.notification.collection import com.android.systemui.statusbar.notification.icon.IconPack import com.android.systemui.statusbar.notification.row.ExpandableNotificationRow import com.android.systemui.statusbar.notification.row.data.repository.BundleRepository import java.util.Collections Loading Loading @@ -43,6 +44,8 @@ class BundleEntry(spec: BundleSpec) : PipelineEntry(spec.key) { var row: ExpandableNotificationRow? = null var icons: IconPack = IconPack.buildEmptyPack(null) private val _children = ArrayList<ListEntry>() /** Loading packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/BundleEntryAdapter.kt +2 −3 Original line number Diff line number Diff line Loading @@ -95,9 +95,8 @@ class BundleEntryAdapter( return 0 } override fun getIcons(): IconPack? { // TODO(b/396446620): implement bundle icons return IconPack.buildEmptyPack(null) override fun getIcons(): IconPack { return entry.icons } override fun isColorized(): Boolean { Loading packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/NotifPipeline.kt +41 −40 Original line number Diff line number Diff line Loading @@ -48,19 +48,18 @@ import javax.inject.Inject * This list differs from the canonical one we receive from system server in a few ways: * - Filtered: Some notifications are filtered out. For example, we filter out notifications whose * views haven't been inflated yet. We also filter out some notifications if we're on the lock * screen and notifications for other users. To participate, see * [.addPreGroupFilter] and similar methods. * screen and notifications for other users. To participate, see [.addPreGroupFilter] and similar * methods. * - Grouped: Notifications that are part of the same group are clustered together into a single * GroupEntry. These groups are then transformed in order to remove children or completely split * them apart. To participate, see [.addPromoter]. * - Sorted: All top-level notifications are sorted. To participate, see * [.setSections] and [.setComparators] * - Sorted: All top-level notifications are sorted. To participate, see [.setSections] and * [.setComparators] * * The exact order of all hooks is as follows: * 0. Collection listeners are fired ([.addCollectionListener]). * 1. Pre-group filters are fired on each notification ([.addPreGroupFilter]). * 2. Initial grouping is performed (NotificationEntries will have their parents set * appropriately). * 2. Initial grouping is performed (NotificationEntries will have their parents set appropriately). * 3. OnBeforeTransformGroupListeners are fired ([.addOnBeforeTransformGroupsListener]) * 4. NotifPromoters are called on each notification with a parent ([.addPromoter]) * 5. OnBeforeSortListeners are fired ([.addOnBeforeSortListener]) Loading @@ -75,10 +74,12 @@ import javax.inject.Inject * 13. OnAfterRenderEntryListeners are fired ([.addOnAfterRenderEntryListener]) */ @SysUISingleton class NotifPipeline @Inject constructor( class NotifPipeline @Inject constructor( private val mNotifCollection: NotifCollection, private val mShadeListBuilder: ShadeListBuilder, private val mRenderStageManager: RenderStageManager private val mRenderStageManager: RenderStageManager, ) : CommonNotifCollection { /** * Returns the list of all known notifications, i.e. the notifications that are currently posted Loading @@ -99,13 +100,16 @@ class NotifPipeline @Inject constructor( mNotifCollection.removeCollectionListener(listener) } /** * Returns the NotificationEntry associated with [key]. */ /** Returns the NotificationEntry associated with [key]. */ override fun getEntry(key: String): NotificationEntry? { return mNotifCollection.getEntry(key) } /** Returns the BundleEntry associated with [key]. */ override fun getBundleEntry(key: String): BundleEntry? { return mShadeListBuilder.getBundleEntry(key) } /** * Registers a lifetime extender. Lifetime extenders can cause notifications that have been * dismissed or retracted by system server to be temporarily retained in the collection. Loading @@ -124,9 +128,9 @@ class NotifPipeline @Inject constructor( /** * Registers a filter with the pipeline before grouping, promoting and sorting occurs. Filters * are called on each notification in the order that they were registered. If any filter * returns true, the notification is removed from the pipeline (and no other filters are * called on that notif). * are called on each notification in the order that they were registered. If any filter returns * true, the notification is removed from the pipeline (and no other filters are called on that * notif). */ fun addPreGroupFilter(filter: NotifFilter) { mShadeListBuilder.addPreGroupFilter(filter) Loading Loading @@ -204,10 +208,9 @@ class NotifPipeline @Inject constructor( /** * Registers a filter with the pipeline to filter right before rendering the list (after * pre-group filtering, grouping, promoting and sorting occurs). Filters are * called on each notification in the order that they were registered. If any filter returns * true, the notification is removed from the pipeline (and no other filters are called on that * notif). * pre-group filtering, grouping, promoting and sorting occurs). Filters are called on each * notification in the order that they were registered. If any filter returns true, the * notification is removed from the pipeline (and no other filters are called on that notif). */ fun addFinalizeFilter(filter: NotifFilter) { mShadeListBuilder.addFinalizeFilter(filter) Loading @@ -233,24 +236,22 @@ class NotifPipeline @Inject constructor( mRenderStageManager.addOnAfterRenderListListener(listener) } /** * Called at the end of the pipeline after a group has been handed off to the view layer. */ /** Called at the end of the pipeline after a group has been handed off to the view layer. */ fun addOnAfterRenderGroupListener(listener: OnAfterRenderGroupListener) { mRenderStageManager.addOnAfterRenderGroupListener(listener) } /** * Called at the end of the pipeline after an entry has been handed off to the view layer. * This will be called for every top level entry, every group summary, and every group child. * Called at the end of the pipeline after an entry has been handed off to the view layer. This * will be called for every top level entry, every group summary, and every group child. */ fun addOnAfterRenderEntryListener(listener: OnAfterRenderEntryListener) { mRenderStageManager.addOnAfterRenderEntryListener(listener) } /** * Get an object which can be used to update a notification (internally to the pipeline) * in response to a user action. * Get an object which can be used to update a notification (internally to the pipeline) in * response to a user action. * * @param name the name of the component that will update notifiations * @return an updater Loading packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/ShadeListBuilder.java +1 −1 Original line number Diff line number Diff line Loading @@ -733,7 +733,7 @@ public class ShadeListBuilder implements Dumpable, PipelineDumpable { } @Nullable private BundleEntry getBundleEntry(String id) { BundleEntry getBundleEntry(String id) { BundleEntry be = mIdToBundleEntry.get(id); if (be == null) { debugBundleLog(TAG, () -> "BundleEntry not found for bundleId: " + id); Loading Loading
packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/notification/collection/BundleEntryAdapterTest.kt +5 −0 Original line number Diff line number Diff line Loading @@ -154,4 +154,9 @@ class BundleEntryAdapterTest : SysuiTestCase() { fun getPeopleNotificationType() { assertThat(underTest.getPeopleNotificationType()).isEqualTo(TYPE_NON_PERSON) } @Test fun getIcons() { assertThat(underTest.icons).isEqualTo(underTest.entry.icons) } }
packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/BundleEntry.kt +3 −0 Original line number Diff line number Diff line Loading @@ -15,6 +15,7 @@ */ package com.android.systemui.statusbar.notification.collection import com.android.systemui.statusbar.notification.icon.IconPack import com.android.systemui.statusbar.notification.row.ExpandableNotificationRow import com.android.systemui.statusbar.notification.row.data.repository.BundleRepository import java.util.Collections Loading Loading @@ -43,6 +44,8 @@ class BundleEntry(spec: BundleSpec) : PipelineEntry(spec.key) { var row: ExpandableNotificationRow? = null var icons: IconPack = IconPack.buildEmptyPack(null) private val _children = ArrayList<ListEntry>() /** Loading
packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/BundleEntryAdapter.kt +2 −3 Original line number Diff line number Diff line Loading @@ -95,9 +95,8 @@ class BundleEntryAdapter( return 0 } override fun getIcons(): IconPack? { // TODO(b/396446620): implement bundle icons return IconPack.buildEmptyPack(null) override fun getIcons(): IconPack { return entry.icons } override fun isColorized(): Boolean { Loading
packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/NotifPipeline.kt +41 −40 Original line number Diff line number Diff line Loading @@ -48,19 +48,18 @@ import javax.inject.Inject * This list differs from the canonical one we receive from system server in a few ways: * - Filtered: Some notifications are filtered out. For example, we filter out notifications whose * views haven't been inflated yet. We also filter out some notifications if we're on the lock * screen and notifications for other users. To participate, see * [.addPreGroupFilter] and similar methods. * screen and notifications for other users. To participate, see [.addPreGroupFilter] and similar * methods. * - Grouped: Notifications that are part of the same group are clustered together into a single * GroupEntry. These groups are then transformed in order to remove children or completely split * them apart. To participate, see [.addPromoter]. * - Sorted: All top-level notifications are sorted. To participate, see * [.setSections] and [.setComparators] * - Sorted: All top-level notifications are sorted. To participate, see [.setSections] and * [.setComparators] * * The exact order of all hooks is as follows: * 0. Collection listeners are fired ([.addCollectionListener]). * 1. Pre-group filters are fired on each notification ([.addPreGroupFilter]). * 2. Initial grouping is performed (NotificationEntries will have their parents set * appropriately). * 2. Initial grouping is performed (NotificationEntries will have their parents set appropriately). * 3. OnBeforeTransformGroupListeners are fired ([.addOnBeforeTransformGroupsListener]) * 4. NotifPromoters are called on each notification with a parent ([.addPromoter]) * 5. OnBeforeSortListeners are fired ([.addOnBeforeSortListener]) Loading @@ -75,10 +74,12 @@ import javax.inject.Inject * 13. OnAfterRenderEntryListeners are fired ([.addOnAfterRenderEntryListener]) */ @SysUISingleton class NotifPipeline @Inject constructor( class NotifPipeline @Inject constructor( private val mNotifCollection: NotifCollection, private val mShadeListBuilder: ShadeListBuilder, private val mRenderStageManager: RenderStageManager private val mRenderStageManager: RenderStageManager, ) : CommonNotifCollection { /** * Returns the list of all known notifications, i.e. the notifications that are currently posted Loading @@ -99,13 +100,16 @@ class NotifPipeline @Inject constructor( mNotifCollection.removeCollectionListener(listener) } /** * Returns the NotificationEntry associated with [key]. */ /** Returns the NotificationEntry associated with [key]. */ override fun getEntry(key: String): NotificationEntry? { return mNotifCollection.getEntry(key) } /** Returns the BundleEntry associated with [key]. */ override fun getBundleEntry(key: String): BundleEntry? { return mShadeListBuilder.getBundleEntry(key) } /** * Registers a lifetime extender. Lifetime extenders can cause notifications that have been * dismissed or retracted by system server to be temporarily retained in the collection. Loading @@ -124,9 +128,9 @@ class NotifPipeline @Inject constructor( /** * Registers a filter with the pipeline before grouping, promoting and sorting occurs. Filters * are called on each notification in the order that they were registered. If any filter * returns true, the notification is removed from the pipeline (and no other filters are * called on that notif). * are called on each notification in the order that they were registered. If any filter returns * true, the notification is removed from the pipeline (and no other filters are called on that * notif). */ fun addPreGroupFilter(filter: NotifFilter) { mShadeListBuilder.addPreGroupFilter(filter) Loading Loading @@ -204,10 +208,9 @@ class NotifPipeline @Inject constructor( /** * Registers a filter with the pipeline to filter right before rendering the list (after * pre-group filtering, grouping, promoting and sorting occurs). Filters are * called on each notification in the order that they were registered. If any filter returns * true, the notification is removed from the pipeline (and no other filters are called on that * notif). * pre-group filtering, grouping, promoting and sorting occurs). Filters are called on each * notification in the order that they were registered. If any filter returns true, the * notification is removed from the pipeline (and no other filters are called on that notif). */ fun addFinalizeFilter(filter: NotifFilter) { mShadeListBuilder.addFinalizeFilter(filter) Loading @@ -233,24 +236,22 @@ class NotifPipeline @Inject constructor( mRenderStageManager.addOnAfterRenderListListener(listener) } /** * Called at the end of the pipeline after a group has been handed off to the view layer. */ /** Called at the end of the pipeline after a group has been handed off to the view layer. */ fun addOnAfterRenderGroupListener(listener: OnAfterRenderGroupListener) { mRenderStageManager.addOnAfterRenderGroupListener(listener) } /** * Called at the end of the pipeline after an entry has been handed off to the view layer. * This will be called for every top level entry, every group summary, and every group child. * Called at the end of the pipeline after an entry has been handed off to the view layer. This * will be called for every top level entry, every group summary, and every group child. */ fun addOnAfterRenderEntryListener(listener: OnAfterRenderEntryListener) { mRenderStageManager.addOnAfterRenderEntryListener(listener) } /** * Get an object which can be used to update a notification (internally to the pipeline) * in response to a user action. * Get an object which can be used to update a notification (internally to the pipeline) in * response to a user action. * * @param name the name of the component that will update notifiations * @return an updater Loading
packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/ShadeListBuilder.java +1 −1 Original line number Diff line number Diff line Loading @@ -733,7 +733,7 @@ public class ShadeListBuilder implements Dumpable, PipelineDumpable { } @Nullable private BundleEntry getBundleEntry(String id) { BundleEntry getBundleEntry(String id) { BundleEntry be = mIdToBundleEntry.get(id); if (be == null) { debugBundleLog(TAG, () -> "BundleEntry not found for bundleId: " + id); Loading