Loading packages/SystemUI/res/xml/media_session_collapsed.xml +1 −1 Original line number Diff line number Diff line Loading @@ -100,7 +100,7 @@ android:layout_marginEnd="@dimen/qs_media_padding" app:layout_constraintEnd_toStartOf="@id/action_button_guideline" app:layout_constrainedWidth="true" app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toEndOf="@id/page_left" app:layout_constraintBottom_toTopOf="@id/header_artist" app:layout_constraintHorizontal_bias="0" /> Loading packages/SystemUI/src/com/android/systemui/media/controls/ui/controller/MediaCarouselController.kt +2 −2 Original line number Diff line number Diff line Loading @@ -168,7 +168,7 @@ constructor( /** Is the player currently visible (at the end of the transformation */ private var playersVisible: Boolean = false /** Are we currently disabling scolling, only allowing the first media session to show */ /** Are we currently disabling scrolling, only allowing the first media session to show */ private var currentlyDisableScrolling: Boolean = false /** Loading Loading @@ -957,7 +957,7 @@ constructor( val nPlayers = MediaPlayerData.players().size MediaPlayerData.players().forEachIndexed { index, mediaPlayer -> if (nPlayers == 1) { if (nPlayers == 1 || currentlyDisableScrolling) { mediaPlayer.setPageArrowsVisible(false) } else { mediaPlayer.setPageArrowsVisible(true) Loading packages/SystemUI/tests/src/com/android/systemui/media/controls/ui/controller/MediaCarouselControllerTest.kt +42 −0 Original line number Diff line number Diff line Loading @@ -1025,6 +1025,48 @@ class MediaCarouselControllerTest : SysuiTestCase() { } } @EnableFlags(Flags.FLAG_MEDIA_CAROUSEL_ARROWS) @DisableSceneContainer @Test fun multipleMediaPlayers_disableScrolling_noPageArrows() { verify(mediaDataManager).addListener(capture(listener)) // Set carousel host to disable scrolling whenever(mediaHostStatesManager.mediaHostStates) .thenReturn(mutableMapOf(LOCATION_QS to mediaHostState)) whenever(mediaHostState.disableScrolling).thenReturn(true) mediaCarouselController.currentEndLocation = LOCATION_QS mediaCarouselController.setCurrentState(LOCATION_QS, LOCATION_QS, 1.0f, true) listener.value.onMediaDataLoaded( PLAYING_LOCAL, null, DATA.copy( active = true, isPlaying = true, playbackLocation = MediaData.PLAYBACK_LOCAL, resumption = false, ), ) listener.value.onMediaDataLoaded( PAUSED_LOCAL, null, DATA.copy( active = true, isPlaying = false, playbackLocation = MediaData.PLAYBACK_LOCAL, resumption = false, ), ) runAllReady() assertEquals(2, MediaPlayerData.players().size) MediaPlayerData.players().forEachIndexed { index, mediaPlayer -> verify(mediaPlayer, atLeast(1)).setPageArrowsVisible(eq(false)) verify(mediaPlayer, never()).setPageArrowsVisible(eq(true)) } } /** * Helper method when a configuration change occurs. * Loading Loading
packages/SystemUI/res/xml/media_session_collapsed.xml +1 −1 Original line number Diff line number Diff line Loading @@ -100,7 +100,7 @@ android:layout_marginEnd="@dimen/qs_media_padding" app:layout_constraintEnd_toStartOf="@id/action_button_guideline" app:layout_constrainedWidth="true" app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toEndOf="@id/page_left" app:layout_constraintBottom_toTopOf="@id/header_artist" app:layout_constraintHorizontal_bias="0" /> Loading
packages/SystemUI/src/com/android/systemui/media/controls/ui/controller/MediaCarouselController.kt +2 −2 Original line number Diff line number Diff line Loading @@ -168,7 +168,7 @@ constructor( /** Is the player currently visible (at the end of the transformation */ private var playersVisible: Boolean = false /** Are we currently disabling scolling, only allowing the first media session to show */ /** Are we currently disabling scrolling, only allowing the first media session to show */ private var currentlyDisableScrolling: Boolean = false /** Loading Loading @@ -957,7 +957,7 @@ constructor( val nPlayers = MediaPlayerData.players().size MediaPlayerData.players().forEachIndexed { index, mediaPlayer -> if (nPlayers == 1) { if (nPlayers == 1 || currentlyDisableScrolling) { mediaPlayer.setPageArrowsVisible(false) } else { mediaPlayer.setPageArrowsVisible(true) Loading
packages/SystemUI/tests/src/com/android/systemui/media/controls/ui/controller/MediaCarouselControllerTest.kt +42 −0 Original line number Diff line number Diff line Loading @@ -1025,6 +1025,48 @@ class MediaCarouselControllerTest : SysuiTestCase() { } } @EnableFlags(Flags.FLAG_MEDIA_CAROUSEL_ARROWS) @DisableSceneContainer @Test fun multipleMediaPlayers_disableScrolling_noPageArrows() { verify(mediaDataManager).addListener(capture(listener)) // Set carousel host to disable scrolling whenever(mediaHostStatesManager.mediaHostStates) .thenReturn(mutableMapOf(LOCATION_QS to mediaHostState)) whenever(mediaHostState.disableScrolling).thenReturn(true) mediaCarouselController.currentEndLocation = LOCATION_QS mediaCarouselController.setCurrentState(LOCATION_QS, LOCATION_QS, 1.0f, true) listener.value.onMediaDataLoaded( PLAYING_LOCAL, null, DATA.copy( active = true, isPlaying = true, playbackLocation = MediaData.PLAYBACK_LOCAL, resumption = false, ), ) listener.value.onMediaDataLoaded( PAUSED_LOCAL, null, DATA.copy( active = true, isPlaying = false, playbackLocation = MediaData.PLAYBACK_LOCAL, resumption = false, ), ) runAllReady() assertEquals(2, MediaPlayerData.players().size) MediaPlayerData.players().forEachIndexed { index, mediaPlayer -> verify(mediaPlayer, atLeast(1)).setPageArrowsVisible(eq(false)) verify(mediaPlayer, never()).setPageArrowsVisible(eq(true)) } } /** * Helper method when a configuration change occurs. * Loading