Loading packages/SystemUI/src/com/android/systemui/media/MediaCarouselController.kt +10 −2 Original line number Diff line number Diff line Loading @@ -535,12 +535,20 @@ class MediaCarouselController @Inject constructor( this.desiredLocation = desiredLocation this.desiredHostState = it currentlyExpanded = it.expansion > 0 val shouldCloseGuts = !currentlyExpanded && !mediaManager.hasActiveMedia() && desiredHostState.showsOnlyActiveMedia for (mediaPlayer in MediaPlayerData.players()) { if (animate) { mediaPlayer.mediaViewController.animatePendingStateChange( duration = duration, delay = startDelay) } if (shouldCloseGuts && mediaPlayer.mediaViewController.isGutsVisible) { mediaPlayer.closeGuts(!animate) } mediaPlayer.mediaViewController.onLocationPreChange(desiredLocation) } mediaCarouselScrollHandler.showsSettingsButton = !it.showsOnlyActiveMedia Loading @@ -556,9 +564,9 @@ class MediaCarouselController @Inject constructor( } } fun closeGuts() { fun closeGuts(immediate: Boolean = true) { MediaPlayerData.players().forEach { it.closeGuts(true) it.closeGuts(immediate) } } Loading packages/SystemUI/src/com/android/systemui/media/MediaCarouselScrollHandler.kt +2 −2 Original line number Diff line number Diff line Loading @@ -59,7 +59,7 @@ class MediaCarouselScrollHandler( private val mainExecutor: DelayableExecutor, private val dismissCallback: () -> Unit, private var translationChangedListener: () -> Unit, private val closeGuts: () -> Unit, private val closeGuts: (immediate: Boolean) -> Unit, private val falsingCollector: FalsingCollector, private val falsingManager: FalsingManager, private val logSmartspaceImpression: () -> Unit Loading Loading @@ -473,7 +473,7 @@ class MediaCarouselScrollHandler( if (oldIndex != visibleMediaIndex && visibleToUser) { logSmartspaceImpression() } closeGuts() closeGuts(false) updatePlayerVisibilities() } val relativeLocation = visibleMediaIndex.toFloat() + if (playerWidthPlusPadding > 0) Loading packages/SystemUI/src/com/android/systemui/media/MediaControlPanel.java +2 −1 Original line number Diff line number Diff line Loading @@ -213,7 +213,8 @@ public class MediaControlPanel { mMediaViewController.openGuts(); return true; } else { return false; closeGuts(); return true; } }); mPlayerViewHolder.getCancel().setOnClickListener(v -> { Loading packages/SystemUI/src/com/android/systemui/media/MediaHierarchyManager.kt +1 −0 Original line number Diff line number Diff line Loading @@ -273,6 +273,7 @@ class MediaHierarchyManager @Inject constructor( } else { updateDesiredLocation() qsExpanded = false closeGuts() } mediaCarouselController.mediaCarouselScrollHandler.visibleToUser = isVisibleToUser() } Loading packages/SystemUI/tests/src/com/android/systemui/media/MediaControlPanelTest.kt +1 −0 Original line number Diff line number Diff line Loading @@ -289,6 +289,7 @@ public class MediaControlPanelTest : SysuiTestCase() { captor.value.onLongClick(holder.player) verify(mediaViewController, never()).openGuts() verify(mediaViewController).closeGuts(false) } @Test Loading Loading
packages/SystemUI/src/com/android/systemui/media/MediaCarouselController.kt +10 −2 Original line number Diff line number Diff line Loading @@ -535,12 +535,20 @@ class MediaCarouselController @Inject constructor( this.desiredLocation = desiredLocation this.desiredHostState = it currentlyExpanded = it.expansion > 0 val shouldCloseGuts = !currentlyExpanded && !mediaManager.hasActiveMedia() && desiredHostState.showsOnlyActiveMedia for (mediaPlayer in MediaPlayerData.players()) { if (animate) { mediaPlayer.mediaViewController.animatePendingStateChange( duration = duration, delay = startDelay) } if (shouldCloseGuts && mediaPlayer.mediaViewController.isGutsVisible) { mediaPlayer.closeGuts(!animate) } mediaPlayer.mediaViewController.onLocationPreChange(desiredLocation) } mediaCarouselScrollHandler.showsSettingsButton = !it.showsOnlyActiveMedia Loading @@ -556,9 +564,9 @@ class MediaCarouselController @Inject constructor( } } fun closeGuts() { fun closeGuts(immediate: Boolean = true) { MediaPlayerData.players().forEach { it.closeGuts(true) it.closeGuts(immediate) } } Loading
packages/SystemUI/src/com/android/systemui/media/MediaCarouselScrollHandler.kt +2 −2 Original line number Diff line number Diff line Loading @@ -59,7 +59,7 @@ class MediaCarouselScrollHandler( private val mainExecutor: DelayableExecutor, private val dismissCallback: () -> Unit, private var translationChangedListener: () -> Unit, private val closeGuts: () -> Unit, private val closeGuts: (immediate: Boolean) -> Unit, private val falsingCollector: FalsingCollector, private val falsingManager: FalsingManager, private val logSmartspaceImpression: () -> Unit Loading Loading @@ -473,7 +473,7 @@ class MediaCarouselScrollHandler( if (oldIndex != visibleMediaIndex && visibleToUser) { logSmartspaceImpression() } closeGuts() closeGuts(false) updatePlayerVisibilities() } val relativeLocation = visibleMediaIndex.toFloat() + if (playerWidthPlusPadding > 0) Loading
packages/SystemUI/src/com/android/systemui/media/MediaControlPanel.java +2 −1 Original line number Diff line number Diff line Loading @@ -213,7 +213,8 @@ public class MediaControlPanel { mMediaViewController.openGuts(); return true; } else { return false; closeGuts(); return true; } }); mPlayerViewHolder.getCancel().setOnClickListener(v -> { Loading
packages/SystemUI/src/com/android/systemui/media/MediaHierarchyManager.kt +1 −0 Original line number Diff line number Diff line Loading @@ -273,6 +273,7 @@ class MediaHierarchyManager @Inject constructor( } else { updateDesiredLocation() qsExpanded = false closeGuts() } mediaCarouselController.mediaCarouselScrollHandler.visibleToUser = isVisibleToUser() } Loading
packages/SystemUI/tests/src/com/android/systemui/media/MediaControlPanelTest.kt +1 −0 Original line number Diff line number Diff line Loading @@ -289,6 +289,7 @@ public class MediaControlPanelTest : SysuiTestCase() { captor.value.onLongClick(holder.player) verify(mediaViewController, never()).openGuts() verify(mediaViewController).closeGuts(false) } @Test Loading