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

Commit 24993c6e authored by Matt Pietal's avatar Matt Pietal
Browse files

Media - Don't clear unless active flag is false

Previously, paused players without the resumption setting would've
removed the player. Don't do it unlesss it is also inactive, due to
timeout or swiping.

Fixes: 169311198
Test: Manual, set resumption off and pause a player
Change-Id: I6d8ec2533528017cfb28e30028b975452df808c7
parent acbb6dd7
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -174,7 +174,7 @@ class MediaCarouselController @Inject constructor(
        mediaManager.addListener(object : MediaDataManager.Listener {
            override fun onMediaDataLoaded(key: String, oldKey: String?, data: MediaData) {
                addOrUpdatePlayer(key, oldKey, data)
                val canRemove = data.isPlaying?.let { !it } ?: data.isClearable
                val canRemove = data.isPlaying?.let { !it } ?: data.isClearable && !data.active
                if (canRemove && !Utils.useMediaResumption(context)) {
                    // This view isn't playing, let's remove this! This happens e.g when
                    // dismissing/timing out a view. We still have the data around because