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

Commit 487c8e94 authored by Michael Mikhail's avatar Michael Mikhail
Browse files

Move media recommendations observer registeration binder to background

Flag: EXEMPT BUGFIX
Bug: 345304469
Test: atest MediaDataProcessorTest
Change-Id: Idce94118deda0aaaf5512cea2c78a59aba8b1e7b
parent 7062fa4a
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -107,6 +107,7 @@ import kotlinx.coroutines.CoroutineDispatcher
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.flow.collectLatest
import kotlinx.coroutines.flow.distinctUntilChanged
import kotlinx.coroutines.flow.flowOn
import kotlinx.coroutines.flow.map
import kotlinx.coroutines.flow.onStart
import kotlinx.coroutines.launch
@@ -371,6 +372,7 @@ class MediaDataProcessor(
            .onStart { emit(Unit) }
            .map { allowMediaRecommendations() }
            .distinctUntilChanged()
            .flowOn(backgroundDispatcher)
            // only track the most recent emission
            .collectLatest {
                allowMediaRecommendations = it