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

Commit dbee5952 authored by Anton Potapov's avatar Anton Potapov
Browse files

Add conflate to the sudio tream flow so it doesn't get overwhelmed by the old

changes

Flag: aconfig new_volume_panel TEAMFOOD
Test: atest AudioInteractorTest
Test: manual on the phone
Bug: 329640818
Change-Id: I1103b87c715aa16d3bfb5d742d233a2d493293d8
parent 139426f7
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -34,6 +34,7 @@ import kotlinx.coroutines.flow.Flow
import kotlinx.coroutines.flow.SharingStarted
import kotlinx.coroutines.flow.StateFlow
import kotlinx.coroutines.flow.callbackFlow
import kotlinx.coroutines.flow.conflate
import kotlinx.coroutines.flow.filter
import kotlinx.coroutines.flow.filterIsInstance
import kotlinx.coroutines.flow.filterNotNull
@@ -134,6 +135,7 @@ class AudioRepositoryImpl(
            }
            .map { getCurrentAudioStream(audioStream) }
            .onStart { emit(getCurrentAudioStream(audioStream)) }
            .conflate()
            .flowOn(backgroundCoroutineContext)
    }