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

Commit f873c219 authored by Jernej Virag's avatar Jernej Virag
Browse files

Move animation scale observer registration Binder to bg thread

Bug: 345304469
Test: atest MediaCarouselControllerTest
Flag: EXEMPT BUGFIX
Change-Id: I38b56ffa9b0c08e9d1195dc4ff9d403699dd61be
parent 89595fde
Loading
Loading
Loading
Loading
+7 −5
Original line number Diff line number Diff line
@@ -216,7 +216,7 @@ constructor(
    private var carouselLocale: Locale? = null

    private val animationScaleObserver: ContentObserver =
        object : ContentObserver(null) {
        object : ContentObserver(executor, 0) {
            override fun onChange(selfChange: Boolean) {
                if (!mediaFlags.isSceneContainerEnabled()) {
                    MediaPlayerData.players().forEach { it.updateAnimatorDurationScale() }
@@ -396,11 +396,13 @@ constructor(
        }

        // Notifies all active players about animation scale changes.
        bgExecutor.execute {
            globalSettings.registerContentObserverSync(
                    Settings.Global.getUriFor(Settings.Global.ANIMATOR_DURATION_SCALE),
                    animationScaleObserver
            )
        }
    }

    private fun setUpListeners() {
        val visualStabilityCallback = OnReorderingAllowedListener {
+5 −4
Original line number Diff line number Diff line
@@ -193,6 +193,7 @@ class MediaCarouselControllerTest : SysuiTestCase() {
        whenever(panel.mediaViewController).thenReturn(mediaViewController)
        whenever(mediaFlags.isPersistentSsCardEnabled()).thenReturn(false)
        MediaPlayerData.clear()
        FakeExecutor.exhaustExecutors(bgExecutor)
        verify(globalSettings)
                .registerContentObserverSync(
                        eq(Settings.Global.getUriFor(Settings.Global.ANIMATOR_DURATION_SCALE)),