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

Commit 3f26a709 authored by Michael Mikhail's avatar Michael Mikhail
Browse files

Send binder call to background thread.

Flag: EXEMPT BUGFIX
Bug: 345304469
Bug: 331800609
Bug: 330801389
Test: atest MediaCarouselControllerTest
Change-Id: Ib087b8bbb6100808e9406a59fda067c8d398baaa
parent 9a6aaa4f
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -106,6 +106,7 @@ import kotlinx.coroutines.Job
import kotlinx.coroutines.flow.collectLatest
import kotlinx.coroutines.flow.distinctUntilChanged
import kotlinx.coroutines.flow.filter
import kotlinx.coroutines.flow.flowOn
import kotlinx.coroutines.flow.map
import kotlinx.coroutines.flow.onStart
import kotlinx.coroutines.launch
@@ -694,6 +695,7 @@ constructor(
                .onStart { emit(Unit) }
                .map { getMediaLockScreenSetting() }
                .distinctUntilChanged()
                .flowOn(backgroundDispatcher)
                .collectLatest {
                    allowMediaPlayerOnLockScreen = it
                    updateHostVisibility()
@@ -882,8 +884,7 @@ constructor(
                    val previousVisibleIndex =
                        MediaPlayerData.playerKeys().indexOfFirst { key -> it == key }
                    mediaCarouselScrollHandler.scrollToPlayer(previousVisibleIndex, mediaIndex)
                }
                    ?: mediaCarouselScrollHandler.scrollToPlayer(destIndex = mediaIndex)
                } ?: mediaCarouselScrollHandler.scrollToPlayer(destIndex = mediaIndex)
            }
        } else if (isRtl && mediaContent.childCount > 0) {
            // In RTL, Scroll to the first player as it is the rightmost player in media carousel.