Don't remove controls prematurely
The test for whether controls can resume can happen while the session is
active, so we don't want to remove them yet if that's the case
Bug: 151103474
Test: manual - play app that can't resume (e.g. GPM) verify controls show,
then pause and swipe from recents, verify controls are removed
Change-Id: I1630feddf7d367299fc7488ddeb376d5fc96748f
diff --git a/packages/SystemUI/src/com/android/systemui/media/MediaControlPanel.java b/packages/SystemUI/src/com/android/systemui/media/MediaControlPanel.java
index f25de6a..8cb0a4e 100644
--- a/packages/SystemUI/src/com/android/systemui/media/MediaControlPanel.java
+++ b/packages/SystemUI/src/com/android/systemui/media/MediaControlPanel.java
@@ -566,8 +566,10 @@
public void onError() {
Log.d(TAG, "Cannot resume with " + componentName);
mServiceComponent = null;
- clearControls();
- // remove
+ if (!hasMediaSession()) {
+ // If it's not active and we can't resume, remove
+ removePlayer();
+ }
}
},
componentName);