Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2978bcd1 authored by Iavor-Valentin Iftime's avatar Iavor-Valentin Iftime Committed by Android (Google) Code Review
Browse files

Merge "Keep icons in bundle header always visible" into main

parents 5a09505f 821ed46b
Loading
Loading
Loading
Loading
+9 −3
Original line number Diff line number Diff line
@@ -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())
@@ -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)
+30 −35
Original line number Diff line number Diff line
@@ -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
@@ -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>) {
@@ -305,7 +301,6 @@ constructor(
                    }
        }
    }
    }

    override fun attach(pipeline: NotifPipeline) {
        if (NotificationBundleUi.isEnabled) {