Loading packages/SystemUI/src/com/android/systemui/media/controls/ui/controller/MediaCarouselController.kt +7 −5 Original line number Original line Diff line number Diff line Loading @@ -216,7 +216,7 @@ constructor( private var carouselLocale: Locale? = null private var carouselLocale: Locale? = null private val animationScaleObserver: ContentObserver = private val animationScaleObserver: ContentObserver = object : ContentObserver(null) { object : ContentObserver(executor, 0) { override fun onChange(selfChange: Boolean) { override fun onChange(selfChange: Boolean) { if (!mediaFlags.isSceneContainerEnabled()) { if (!mediaFlags.isSceneContainerEnabled()) { MediaPlayerData.players().forEach { it.updateAnimatorDurationScale() } MediaPlayerData.players().forEach { it.updateAnimatorDurationScale() } Loading Loading @@ -396,11 +396,13 @@ constructor( } } // Notifies all active players about animation scale changes. // Notifies all active players about animation scale changes. bgExecutor.execute { globalSettings.registerContentObserverSync( globalSettings.registerContentObserverSync( Settings.Global.getUriFor(Settings.Global.ANIMATOR_DURATION_SCALE), Settings.Global.getUriFor(Settings.Global.ANIMATOR_DURATION_SCALE), animationScaleObserver animationScaleObserver ) ) } } } private fun setUpListeners() { private fun setUpListeners() { val visualStabilityCallback = OnReorderingAllowedListener { val visualStabilityCallback = OnReorderingAllowedListener { Loading packages/SystemUI/tests/src/com/android/systemui/media/controls/ui/controller/MediaCarouselControllerTest.kt +5 −4 Original line number Original line Diff line number Diff line Loading @@ -193,6 +193,7 @@ class MediaCarouselControllerTest : SysuiTestCase() { whenever(panel.mediaViewController).thenReturn(mediaViewController) whenever(panel.mediaViewController).thenReturn(mediaViewController) whenever(mediaFlags.isPersistentSsCardEnabled()).thenReturn(false) whenever(mediaFlags.isPersistentSsCardEnabled()).thenReturn(false) MediaPlayerData.clear() MediaPlayerData.clear() FakeExecutor.exhaustExecutors(bgExecutor) verify(globalSettings) verify(globalSettings) .registerContentObserverSync( .registerContentObserverSync( eq(Settings.Global.getUriFor(Settings.Global.ANIMATOR_DURATION_SCALE)), eq(Settings.Global.getUriFor(Settings.Global.ANIMATOR_DURATION_SCALE)), Loading Loading
packages/SystemUI/src/com/android/systemui/media/controls/ui/controller/MediaCarouselController.kt +7 −5 Original line number Original line Diff line number Diff line Loading @@ -216,7 +216,7 @@ constructor( private var carouselLocale: Locale? = null private var carouselLocale: Locale? = null private val animationScaleObserver: ContentObserver = private val animationScaleObserver: ContentObserver = object : ContentObserver(null) { object : ContentObserver(executor, 0) { override fun onChange(selfChange: Boolean) { override fun onChange(selfChange: Boolean) { if (!mediaFlags.isSceneContainerEnabled()) { if (!mediaFlags.isSceneContainerEnabled()) { MediaPlayerData.players().forEach { it.updateAnimatorDurationScale() } MediaPlayerData.players().forEach { it.updateAnimatorDurationScale() } Loading Loading @@ -396,11 +396,13 @@ constructor( } } // Notifies all active players about animation scale changes. // Notifies all active players about animation scale changes. bgExecutor.execute { globalSettings.registerContentObserverSync( globalSettings.registerContentObserverSync( Settings.Global.getUriFor(Settings.Global.ANIMATOR_DURATION_SCALE), Settings.Global.getUriFor(Settings.Global.ANIMATOR_DURATION_SCALE), animationScaleObserver animationScaleObserver ) ) } } } private fun setUpListeners() { private fun setUpListeners() { val visualStabilityCallback = OnReorderingAllowedListener { val visualStabilityCallback = OnReorderingAllowedListener { Loading
packages/SystemUI/tests/src/com/android/systemui/media/controls/ui/controller/MediaCarouselControllerTest.kt +5 −4 Original line number Original line Diff line number Diff line Loading @@ -193,6 +193,7 @@ class MediaCarouselControllerTest : SysuiTestCase() { whenever(panel.mediaViewController).thenReturn(mediaViewController) whenever(panel.mediaViewController).thenReturn(mediaViewController) whenever(mediaFlags.isPersistentSsCardEnabled()).thenReturn(false) whenever(mediaFlags.isPersistentSsCardEnabled()).thenReturn(false) MediaPlayerData.clear() MediaPlayerData.clear() FakeExecutor.exhaustExecutors(bgExecutor) verify(globalSettings) verify(globalSettings) .registerContentObserverSync( .registerContentObserverSync( eq(Settings.Global.getUriFor(Settings.Global.ANIMATOR_DURATION_SCALE)), eq(Settings.Global.getUriFor(Settings.Global.ANIMATOR_DURATION_SCALE)), Loading