Closed luca020400 closed 1 month ago
Can't you just add .conflate() to playbackStatusFlow?
channelFlow also exists, I have no idea if there's a difference
Can't you just add .conflate() to playbackStatusFlow?
Yes, but I'm splitting all playback updates into singular flows to avoid uneeded UI updates and all of them are conflated
Also https://cs.android.com/android/platform/superproject/main/+/main:frameworks/base/packages/SystemUI/utils/src/com/android/systemui/utils/coroutines/flow/FlowConflated.kt https://cs.android.com/android/platform/superproject/main/+/main:frameworks/base/packages/SystemUI/utils/src/com/android/systemui/utils/coroutines/flow/LatestConflated.kt
Google uses callbackFlow (conflated) every time there is a callback, so that seems to me the correct thing to use at least for us, also callbackFlow extends ChannelFlow.
callbackFlow has an internal buffer that most of the time we don't care about.
Switch the player to that.