Loading packages/SystemUI/src/com/android/systemui/media/controls/ui/controller/MediaCarouselController.kt +9 −8 Original line number Diff line number Diff line Loading @@ -321,7 +321,7 @@ constructor( } private val isReorderingAllowed: Boolean get() = visualStabilityProvider.isReorderingAllowed get() = visualStabilityProvider.isReorderingAllowed && !isOnLockscreen() /** Size provided by the scene framework container */ private var widthInSceneContainerPx = 0 Loading Loading @@ -731,14 +731,15 @@ constructor( /** Return true if the carousel should be hidden because device is locked. */ fun isLockedAndHidden(): Boolean { val isOnLockscreen = return !allowMediaPlayerOnLockScreen && isOnLockscreen() } private fun isOnLockscreen() = if (SceneContainerFlag.isEnabled) { !deviceEntryInteractor.isDeviceEntered.value } else { !isOnGone.value || isGoingToDozing.value } return !allowMediaPlayerOnLockScreen && isOnLockscreen } private fun reorderAllPlayers( previousVisiblePlayerKey: MediaPlayerData.MediaSortKey?, Loading packages/SystemUI/tests/src/com/android/systemui/media/controls/ui/controller/MediaCarouselControllerTest.kt +29 −19 Original line number Diff line number Diff line Loading @@ -879,11 +879,21 @@ class MediaCarouselControllerTest : SysuiTestCase() { @DisableSceneContainer @Test fun swipeToDismiss_pausedAndResumeOff_userInitiated() { fun swipeToDismiss_pausedAndResumeOff_userInitiated() = kosmos.testScope.runTest { verify(mediaDataManager).addListener(capture(listener)) transitionRepository.sendTransitionSteps( from = KeyguardState.LOCKSCREEN, to = KeyguardState.GONE, this, ) // When resumption is disabled, paused media should be dismissed after being swiped away Settings.Secure.putInt(context.contentResolver, Settings.Secure.MEDIA_CONTROLS_RESUME, 0) Settings.Secure.putInt( context.contentResolver, Settings.Secure.MEDIA_CONTROLS_RESUME, 0, ) val pausedMedia = DATA.copy(isPlaying = false) listener.value.onMediaDataLoaded(PAUSED_LOCAL, PAUSED_LOCAL, pausedMedia) runAllReady() Loading Loading
packages/SystemUI/src/com/android/systemui/media/controls/ui/controller/MediaCarouselController.kt +9 −8 Original line number Diff line number Diff line Loading @@ -321,7 +321,7 @@ constructor( } private val isReorderingAllowed: Boolean get() = visualStabilityProvider.isReorderingAllowed get() = visualStabilityProvider.isReorderingAllowed && !isOnLockscreen() /** Size provided by the scene framework container */ private var widthInSceneContainerPx = 0 Loading Loading @@ -731,14 +731,15 @@ constructor( /** Return true if the carousel should be hidden because device is locked. */ fun isLockedAndHidden(): Boolean { val isOnLockscreen = return !allowMediaPlayerOnLockScreen && isOnLockscreen() } private fun isOnLockscreen() = if (SceneContainerFlag.isEnabled) { !deviceEntryInteractor.isDeviceEntered.value } else { !isOnGone.value || isGoingToDozing.value } return !allowMediaPlayerOnLockScreen && isOnLockscreen } private fun reorderAllPlayers( previousVisiblePlayerKey: MediaPlayerData.MediaSortKey?, Loading
packages/SystemUI/tests/src/com/android/systemui/media/controls/ui/controller/MediaCarouselControllerTest.kt +29 −19 Original line number Diff line number Diff line Loading @@ -879,11 +879,21 @@ class MediaCarouselControllerTest : SysuiTestCase() { @DisableSceneContainer @Test fun swipeToDismiss_pausedAndResumeOff_userInitiated() { fun swipeToDismiss_pausedAndResumeOff_userInitiated() = kosmos.testScope.runTest { verify(mediaDataManager).addListener(capture(listener)) transitionRepository.sendTransitionSteps( from = KeyguardState.LOCKSCREEN, to = KeyguardState.GONE, this, ) // When resumption is disabled, paused media should be dismissed after being swiped away Settings.Secure.putInt(context.contentResolver, Settings.Secure.MEDIA_CONTROLS_RESUME, 0) Settings.Secure.putInt( context.contentResolver, Settings.Secure.MEDIA_CONTROLS_RESUME, 0, ) val pausedMedia = DATA.copy(isPlaying = false) listener.value.onMediaDataLoaded(PAUSED_LOCAL, PAUSED_LOCAL, pausedMedia) runAllReady() Loading