Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a404f323 authored by Justin Weir's avatar Justin Weir Committed by Automerger Merge Worker
Browse files

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

Merge "Add lastActive to the media carousel sort comparator" into tm-dev am: c073bcee am: 008a21e0 am: b5c4fe5a

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



Change-Id: I370897e0bad5cd64fbb1c3534a611e3b4f879672
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents ad2f3172 b5c4fe5a
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -948,6 +948,7 @@ internal object MediaPlayerData {
        .thenByDescending { shouldPrioritizeSs == it.isSsMediaRec }
        .thenByDescending { !it.data.resumption }
        .thenByDescending { it.data.playbackLocation != MediaData.PLAYBACK_CAST_REMOTE }
        .thenByDescending { it.data.lastActive }
        .thenByDescending { it.updateTime }
        .thenByDescending { it.data.notificationKey }

+10 −1
Original line number Diff line number Diff line
@@ -139,6 +139,15 @@ class MediaCarouselControllerTest : SysuiTestCase() {
                playbackLocation = MediaData.PLAYBACK_LOCAL, resumption = true),
            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:
        // Actively playing local sessions
        // Actively playing cast sessions