summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Matt Pietal <mpietal@google.com> 2020-09-24 08:17:16 -0400
committer Matt Pietal <mpietal@google.com> 2020-09-24 08:26:45 -0400
commit24993c6ee7e8da73989503e9302a3337c02cb004 (patch)
treed95208c90533fba8bba586139650de5737464aba
parentacbb6dd7729a254295b34e6513bab1a0de9b34ed (diff)
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
-rw-r--r--packages/SystemUI/src/com/android/systemui/media/MediaCarouselController.kt2
1 files changed, 1 insertions, 1 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/media/MediaCarouselController.kt b/packages/SystemUI/src/com/android/systemui/media/MediaCarouselController.kt
index 636f42089743..c2d6cd445fa9 100644
--- a/packages/SystemUI/src/com/android/systemui/media/MediaCarouselController.kt
+++ b/packages/SystemUI/src/com/android/systemui/media/MediaCarouselController.kt
@@ -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