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

Commit 2c167c08 authored by Jernej Virag's avatar Jernej Virag Committed by Android (Google) Code Review
Browse files

Merge "Move animation scale observer registration Binder to bg thread" into main

parents c7529cb8 f873c219
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)),