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