From 24993c6ee7e8da73989503e9302a3337c02cb004 Mon Sep 17 00:00:00 2001 From: Matt Pietal Date: Thu, 24 Sep 2020 08:17:16 -0400 Subject: [PATCH] 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 --- .../src/com/android/systemui/media/MediaCarouselController.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/SystemUI/src/com/android/systemui/media/MediaCarouselController.kt b/packages/SystemUI/src/com/android/systemui/media/MediaCarouselController.kt index 636f420897432..c2d6cd445fa9f 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