Loading packages/SystemUI/src/com/android/systemui/media/controls/ui/MediaHierarchyManager.kt +4 −8 Original line number Diff line number Diff line Loading @@ -586,7 +586,7 @@ constructor( coroutineScope.launch { communalInteractor.isCommunalShowing.collect { value -> isCommunalShowing = value updateDesiredLocation() updateDesiredLocation(forceNoAnimation = true) } } } Loading Loading @@ -1149,17 +1149,13 @@ constructor( when { mediaFlags.isSceneContainerEnabled() -> desiredLocation dreamOverlayActive && dreamMediaComplicationActive -> LOCATION_DREAM_OVERLAY // UMO should show in communal unless the shade is expanding or visible. isCommunalShowing && qsExpansion == 0.0f -> LOCATION_COMMUNAL_HUB (qsExpansion > 0.0f || inSplitShade) && !onLockscreen -> LOCATION_QS qsExpansion > 0.4f && onLockscreen -> LOCATION_QS onLockscreen && isSplitShadeExpanding() -> LOCATION_QS onLockscreen && isTransformingToFullShadeAndInQQS() -> LOCATION_QQS // Communal does not have its own StatusBarState so it should always have higher // priority for the UMO over the lockscreen. isCommunalShowing -> LOCATION_COMMUNAL_HUB // TODO(b/311234666): revisit logic once interactions between the hub and // shade/keyguard state are finalized isCommunalShowing && communalInteractor.isCommunalEnabled -> LOCATION_COMMUNAL_HUB onLockscreen && allowMediaPlayerOnLockScreen -> LOCATION_LOCKSCREEN else -> LOCATION_QQS } Loading packages/SystemUI/tests/src/com/android/systemui/media/controls/ui/MediaHierarchyManagerTest.kt +0 −52 Original line number Diff line number Diff line Loading @@ -531,58 +531,6 @@ class MediaHierarchyManagerTest : SysuiTestCase() { ) } @Test fun testCommunalLocation_showsOverLockscreen() = testScope.runTest { // Device is on lock screen. whenever(statusBarStateController.state).thenReturn(StatusBarState.KEYGUARD) // UMO goes to communal even over the lock screen. communalInteractor.onSceneChanged(CommunalSceneKey.Communal) runCurrent() verify(mediaCarouselController) .onDesiredLocationChanged( eq(MediaHierarchyManager.LOCATION_COMMUNAL_HUB), nullable(), eq(false), anyLong(), anyLong() ) } @Test fun testCommunalLocation_showsUntilQsExpands() = testScope.runTest { // Device is on lock screen. whenever(statusBarStateController.state).thenReturn(StatusBarState.KEYGUARD) communalInteractor.onSceneChanged(CommunalSceneKey.Communal) runCurrent() verify(mediaCarouselController) .onDesiredLocationChanged( eq(MediaHierarchyManager.LOCATION_COMMUNAL_HUB), nullable(), eq(false), anyLong(), anyLong() ) clearInvocations(mediaCarouselController) // Start opening the shade. mediaHierarchyManager.qsExpansion = 0.1f runCurrent() // UMO goes to the shade instead. verify(mediaCarouselController) .onDesiredLocationChanged( eq(MediaHierarchyManager.LOCATION_QS), any(MediaHostState::class.java), eq(false), anyLong(), anyLong() ) } @Test fun testQsExpandedChanged_noQqsMedia() { // When we are looking at QQS with active media Loading Loading
packages/SystemUI/src/com/android/systemui/media/controls/ui/MediaHierarchyManager.kt +4 −8 Original line number Diff line number Diff line Loading @@ -586,7 +586,7 @@ constructor( coroutineScope.launch { communalInteractor.isCommunalShowing.collect { value -> isCommunalShowing = value updateDesiredLocation() updateDesiredLocation(forceNoAnimation = true) } } } Loading Loading @@ -1149,17 +1149,13 @@ constructor( when { mediaFlags.isSceneContainerEnabled() -> desiredLocation dreamOverlayActive && dreamMediaComplicationActive -> LOCATION_DREAM_OVERLAY // UMO should show in communal unless the shade is expanding or visible. isCommunalShowing && qsExpansion == 0.0f -> LOCATION_COMMUNAL_HUB (qsExpansion > 0.0f || inSplitShade) && !onLockscreen -> LOCATION_QS qsExpansion > 0.4f && onLockscreen -> LOCATION_QS onLockscreen && isSplitShadeExpanding() -> LOCATION_QS onLockscreen && isTransformingToFullShadeAndInQQS() -> LOCATION_QQS // Communal does not have its own StatusBarState so it should always have higher // priority for the UMO over the lockscreen. isCommunalShowing -> LOCATION_COMMUNAL_HUB // TODO(b/311234666): revisit logic once interactions between the hub and // shade/keyguard state are finalized isCommunalShowing && communalInteractor.isCommunalEnabled -> LOCATION_COMMUNAL_HUB onLockscreen && allowMediaPlayerOnLockScreen -> LOCATION_LOCKSCREEN else -> LOCATION_QQS } Loading
packages/SystemUI/tests/src/com/android/systemui/media/controls/ui/MediaHierarchyManagerTest.kt +0 −52 Original line number Diff line number Diff line Loading @@ -531,58 +531,6 @@ class MediaHierarchyManagerTest : SysuiTestCase() { ) } @Test fun testCommunalLocation_showsOverLockscreen() = testScope.runTest { // Device is on lock screen. whenever(statusBarStateController.state).thenReturn(StatusBarState.KEYGUARD) // UMO goes to communal even over the lock screen. communalInteractor.onSceneChanged(CommunalSceneKey.Communal) runCurrent() verify(mediaCarouselController) .onDesiredLocationChanged( eq(MediaHierarchyManager.LOCATION_COMMUNAL_HUB), nullable(), eq(false), anyLong(), anyLong() ) } @Test fun testCommunalLocation_showsUntilQsExpands() = testScope.runTest { // Device is on lock screen. whenever(statusBarStateController.state).thenReturn(StatusBarState.KEYGUARD) communalInteractor.onSceneChanged(CommunalSceneKey.Communal) runCurrent() verify(mediaCarouselController) .onDesiredLocationChanged( eq(MediaHierarchyManager.LOCATION_COMMUNAL_HUB), nullable(), eq(false), anyLong(), anyLong() ) clearInvocations(mediaCarouselController) // Start opening the shade. mediaHierarchyManager.qsExpansion = 0.1f runCurrent() // UMO goes to the shade instead. verify(mediaCarouselController) .onDesiredLocationChanged( eq(MediaHierarchyManager.LOCATION_QS), any(MediaHostState::class.java), eq(false), anyLong(), anyLong() ) } @Test fun testQsExpandedChanged_noQqsMedia() { // When we are looking at QQS with active media Loading