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

Commit 9f10b43f authored by András Kurucz's avatar András Kurucz
Browse files

[Flexiglass] Don't emit the same values from Set<HeadsUpRowKey> flows

Only emit from the Set<HeadsUpRowKey> flows if there is a change, to make
the binder's job easier when it is diffing for previous keys to generate
animation events.

Bug: 400691495
Flag: com.android.systemui.scene_container
Test: observe HUN intro/outro animations

Change-Id: I75f7cae9fd87b5d869d17976bf37ba06b6da26a3
parent c25bc7a0
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -81,7 +81,7 @@ constructor(
        if (SceneContainerFlag.isUnexpectedlyInLegacyMode()) {
            flowOf(emptySet())
        } else {
            activeHeadsUpRows.map { it.map { (repo, _) -> repo }.toSet() }
            activeHeadsUpRows.map { it.map { (repo, _) -> repo }.toSet() }.distinctUntilChanged()
        }
    }

@@ -90,9 +90,9 @@ constructor(
        if (SceneContainerFlag.isUnexpectedlyInLegacyMode()) {
            flowOf(emptySet())
        } else {
            activeHeadsUpRows.map {
                it.filter { (_, isPinned) -> isPinned }.map { (repo, _) -> repo }.toSet()
            }
            activeHeadsUpRows
                .map { it.filter { (_, isPinned) -> isPinned }.map { (repo, _) -> repo }.toSet() }
                .distinctUntilChanged() // TODO(b/402428276) stop sending duplicate updates instead
        }
    }