Merge "Add lastActive to the media carousel sort comparator" into tm-dev am: c073bceed0

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/18487002

Change-Id: I704d6689f2c9f616468b324233613ff24eee22de
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Justin Weir
2022-05-20 19:44:08 +00:00
committed by Automerger Merge Worker
2 changed files with 11 additions and 1 deletions

View File

@@ -948,6 +948,7 @@ internal object MediaPlayerData {
.thenByDescending { shouldPrioritizeSs == it.isSsMediaRec } .thenByDescending { shouldPrioritizeSs == it.isSsMediaRec }
.thenByDescending { !it.data.resumption } .thenByDescending { !it.data.resumption }
.thenByDescending { it.data.playbackLocation != MediaData.PLAYBACK_CAST_REMOTE } .thenByDescending { it.data.playbackLocation != MediaData.PLAYBACK_CAST_REMOTE }
.thenByDescending { it.data.lastActive }
.thenByDescending { it.updateTime } .thenByDescending { it.updateTime }
.thenByDescending { it.data.notificationKey } .thenByDescending { it.data.notificationKey }

View File

@@ -136,9 +136,18 @@ class MediaCarouselControllerTest : SysuiTestCase() {
val resume2 = Triple("resume 2", val resume2 = Triple("resume 2",
DATA.copy(active = false, isPlaying = false, DATA.copy(active = false, isPlaying = false,
playbackLocation = MediaData.PLAYBACK_LOCAL, resumption = true), playbackLocation = MediaData.PLAYBACK_LOCAL, resumption = true),
1000L) 1000L)
val activeMoreRecent = Triple("active more recent",
DATA.copy(active = false, isPlaying = false,
playbackLocation = MediaData.PLAYBACK_LOCAL, resumption = true, lastActive = 2L),
1000L)
val activeLessRecent = Triple("active less recent",
DATA.copy(active = false, isPlaying = false,
playbackLocation = MediaData.PLAYBACK_LOCAL, resumption = true, lastActive = 1L),
1000L)
// Expected ordering for media players: // Expected ordering for media players:
// Actively playing local sessions // Actively playing local sessions
// Actively playing cast sessions // Actively playing cast sessions