From 36fc7e464ef3ce047b2626ee1b9e72ae9fe5e6cd Mon Sep 17 00:00:00 2001 From: Jeff DeCew Date: Mon, 2 Nov 2020 13:06:16 -0500 Subject: [PATCH] Fix non-dismissible resumption players. Ensure resumption players created when a non-dismissible notification is cancelled force the 'isClearable' flag to true. This fixes a bug where a resumption player is non-dismissable. Test: manual - Finish item in Pocket Casts, attempt long-press dismiss. Bug: 169271494 Change-Id: I186f9ee6fc228ad5bd1d49970fb44709783b74dc Merged-In: I186f9ee6fc228ad5bd1d49970fb44709783b74dc (cherry picked from commit 656e986464a059c21de86a432c479384cf45be0a) --- .../src/com/android/systemui/media/MediaDataManager.kt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/SystemUI/src/com/android/systemui/media/MediaDataManager.kt b/packages/SystemUI/src/com/android/systemui/media/MediaDataManager.kt index bb11efeebf08c..2be509a138163 100644 --- a/packages/SystemUI/src/com/android/systemui/media/MediaDataManager.kt +++ b/packages/SystemUI/src/com/android/systemui/media/MediaDataManager.kt @@ -609,7 +609,8 @@ class MediaDataManager( // Move to resume key (aka package name) if that key doesn't already exist. val resumeAction = getResumeMediaAction(removed.resumeAction!!) val updated = removed.copy(token = null, actions = listOf(resumeAction), - actionsToShowInCompact = listOf(0), active = false, resumption = true) + actionsToShowInCompact = listOf(0), active = false, resumption = true, + isClearable = true) val pkg = removed?.packageName val migrate = mediaEntries.put(pkg, updated) == null // Notify listeners of "new" controls when migrating or removed and update when not