From 738428c9825d1855bcd05605ffbb3fe82aadd713 Mon Sep 17 00:00:00 2001 From: Lucas Dupin Date: Mon, 29 Jun 2020 19:50:33 -0700 Subject: [PATCH] Fix issue where player would not be dismissed A player might try to connect when coming back from a resumable state, but might never finish the operation, beeing stuck on quick settings. From now on, players that are trying to connect will not be considered active anymore. Fixes: 159491565 Test: manual Change-Id: Ib3aa12d5f0566845c7fc9556b5a63dfd95b8defc --- .../statusbar/NotificationMediaManager.java | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/NotificationMediaManager.java b/packages/SystemUI/src/com/android/systemui/statusbar/NotificationMediaManager.java index 5628a24f40ef1..739d30c2a707e 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/NotificationMediaManager.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/NotificationMediaManager.java @@ -100,12 +100,7 @@ public class NotificationMediaManager implements Dumpable { PAUSED_MEDIA_STATES.add(PlaybackState.STATE_STOPPED); PAUSED_MEDIA_STATES.add(PlaybackState.STATE_PAUSED); PAUSED_MEDIA_STATES.add(PlaybackState.STATE_ERROR); - } - private static final HashSet INACTIVE_MEDIA_STATES = new HashSet<>(); - static { - INACTIVE_MEDIA_STATES.add(PlaybackState.STATE_NONE); - INACTIVE_MEDIA_STATES.add(PlaybackState.STATE_STOPPED); - INACTIVE_MEDIA_STATES.add(PlaybackState.STATE_ERROR); + PAUSED_MEDIA_STATES.add(PlaybackState.STATE_CONNECTING); } private final NotificationEntryManager mEntryManager; @@ -262,15 +257,6 @@ public class NotificationMediaManager implements Dumpable { return !PAUSED_MEDIA_STATES.contains(state); } - /** - * Check if a state should be considered active (playing or paused) - * @param state a PlaybackState - * @return true if active - */ - public static boolean isActiveState(int state) { - return !INACTIVE_MEDIA_STATES.contains(state); - } - public void setUpWithPresenter(NotificationPresenter presenter) { mPresenter = presenter; }