Loading packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/notification/collection/coordinator/BundleCoordinatorTest.kt +9 −3 Original line number Diff line number Diff line Loading @@ -391,7 +391,7 @@ class BundleCoordinatorTest : SysuiTestCase() { @EnableFlags(NotificationBundleUi.FLAG_NAME) @Test fun appDataUpdater_twoNotifsWhileCollapsed_emptyAfterExpand() { fun appDataUpdater_twoNotifsWhileExpanded_updatedWhenRemoved() = runTest { val bundle = BundleEntry(TEST_BUNDLE_SPEC) bundle.bundleRepository.state = MutableSceneTransitionLayoutState(BundleHeader.Scenes.Expanded, MotionScheme.standard()) Loading @@ -408,10 +408,16 @@ class BundleCoordinatorTest : SysuiTestCase() { bundle.addChild(notif1) bundle.addChild(notif2) bundle.bundleRepository.appDataList.value = listOf(AppData(pkg1, user1, time1)) coordinator.bundleAppDataUpdater.onBeforeRenderList(listOf(bundle)) assertThat(currentValue(bundle.bundleRepository.appDataList)) .containsExactly(AppData(pkg1, user1, time1), AppData(pkg2, user2, time2)) bundle.removeChild(notif1) coordinator.bundleAppDataUpdater.onBeforeRenderList(listOf(bundle)) assertThat(bundle.bundleRepository.appDataList.value).isEmpty() assertThat(currentValue(bundle.bundleRepository.appDataList)) .containsExactly(AppData(pkg2, user2, time2)) } @EnableFlags(NotificationBundleUi.FLAG_NAME) Loading packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/coordinator/BundleCoordinator.kt +30 −35 Original line number Diff line number Diff line Loading @@ -25,7 +25,6 @@ import android.os.SystemProperties import android.os.UserHandle import androidx.annotation.VisibleForTesting import com.android.systemui.dagger.qualifiers.Application import com.android.systemui.notifications.ui.composable.row.BundleHeader import com.android.systemui.statusbar.notification.Bundles import com.android.systemui.statusbar.notification.OnboardingAffordanceManager import com.android.systemui.statusbar.notification.collection.BundleEntry Loading Loading @@ -264,9 +263,6 @@ constructor( @get:VisibleForTesting val bundleAppDataUpdater = OnBeforeRenderListListener { entries -> entries.forEachBundleEntry { bundleEntry -> if (bundleEntry.bundleRepository.state?.currentScene == BundleHeader.Scenes.Expanded) { bundleEntry.bundleRepository.appDataList.value = emptyList() } else { val appDataList = mutableListOf<AppData>() fun collectAppData(listEntries: List<ListEntry>) { Loading Loading @@ -305,7 +301,6 @@ constructor( } } } } override fun attach(pipeline: NotifPipeline) { if (NotificationBundleUi.isEnabled) { Loading Loading
packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/notification/collection/coordinator/BundleCoordinatorTest.kt +9 −3 Original line number Diff line number Diff line Loading @@ -391,7 +391,7 @@ class BundleCoordinatorTest : SysuiTestCase() { @EnableFlags(NotificationBundleUi.FLAG_NAME) @Test fun appDataUpdater_twoNotifsWhileCollapsed_emptyAfterExpand() { fun appDataUpdater_twoNotifsWhileExpanded_updatedWhenRemoved() = runTest { val bundle = BundleEntry(TEST_BUNDLE_SPEC) bundle.bundleRepository.state = MutableSceneTransitionLayoutState(BundleHeader.Scenes.Expanded, MotionScheme.standard()) Loading @@ -408,10 +408,16 @@ class BundleCoordinatorTest : SysuiTestCase() { bundle.addChild(notif1) bundle.addChild(notif2) bundle.bundleRepository.appDataList.value = listOf(AppData(pkg1, user1, time1)) coordinator.bundleAppDataUpdater.onBeforeRenderList(listOf(bundle)) assertThat(currentValue(bundle.bundleRepository.appDataList)) .containsExactly(AppData(pkg1, user1, time1), AppData(pkg2, user2, time2)) bundle.removeChild(notif1) coordinator.bundleAppDataUpdater.onBeforeRenderList(listOf(bundle)) assertThat(bundle.bundleRepository.appDataList.value).isEmpty() assertThat(currentValue(bundle.bundleRepository.appDataList)) .containsExactly(AppData(pkg2, user2, time2)) } @EnableFlags(NotificationBundleUi.FLAG_NAME) Loading
packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/coordinator/BundleCoordinator.kt +30 −35 Original line number Diff line number Diff line Loading @@ -25,7 +25,6 @@ import android.os.SystemProperties import android.os.UserHandle import androidx.annotation.VisibleForTesting import com.android.systemui.dagger.qualifiers.Application import com.android.systemui.notifications.ui.composable.row.BundleHeader import com.android.systemui.statusbar.notification.Bundles import com.android.systemui.statusbar.notification.OnboardingAffordanceManager import com.android.systemui.statusbar.notification.collection.BundleEntry Loading Loading @@ -264,9 +263,6 @@ constructor( @get:VisibleForTesting val bundleAppDataUpdater = OnBeforeRenderListListener { entries -> entries.forEachBundleEntry { bundleEntry -> if (bundleEntry.bundleRepository.state?.currentScene == BundleHeader.Scenes.Expanded) { bundleEntry.bundleRepository.appDataList.value = emptyList() } else { val appDataList = mutableListOf<AppData>() fun collectAppData(listEntries: List<ListEntry>) { Loading Loading @@ -305,7 +301,6 @@ constructor( } } } } override fun attach(pipeline: NotifPipeline) { if (NotificationBundleUi.isEnabled) { Loading