App version: 1.8.1 (from Google Play Store)
Android version: 11
Device model: Pixel 3
In the new media controls in Android 11, media sessions are not closed out when the app stops. This leads to several copies of AntennaPod media sessions accumulating over time in the media controls list of running sessions. It appears that a new session is created each time the app is closed either normally, or by force stopping.
Steps to reproduce:
Expected behaviour:
At step 2, the media session should be closed and no longer appear in the media controls list.
Current behaviour:
The old media session lingers when closing the app, and new ones are started when playing again, making sessions accumulate in the media controls panel until the phone is rebooted.
First occurred:
When updated to Android 11.
Environment:
Using the built-in Android Player, though it also seems to happen on ExoPlayer.
Notes:
Screenshots:

Hmm. We already release the media session when the service is stopped, just like it is recommended by Google. I do also get multiple session controls at the same time, though. Not sure what is going wrong :(
I can confirm this is happening on AntennaPod 2.0.0, Pixel 3xla and Android 11
I'm not sure that adding on will help too much, but I'm on the following environment seeing the same.
[ Environment ]
Android version: 11
OS version: 4.4.223-g1bc566a21f60-ab6662096
AntennaPod version: 1.8.1
Model: Pixel 2 XL
Device: taimen
Product: taimen
No crash report recorded
Can anyone figure out how to cause this lingering control to appear? Even though I notice the problem, after I reboot my phone, I was not able to replicate the problem. But after a while using AntennaPod, I see 4 lingering panels
If I remember correctly, I had to press the pause button in the media controls section, not within AntennaPod.
I cannot replicate this problem consistently. It does happy on my Android 11 phone. Can anyone else reliable cause this problem to happen so I can trace down the issue in the code?I think Android 11 has a new way to handle the media controls
I was able to reproduce it like this:
Used AntennaPod 1.8.1 (6e6a64f50)
1. Launch episode (I streamed).
1.a. Let play for 5-10 seconds (Dont know if this is really needed)
2. Make sure it appears in the quick launcher with media controls.
Maybe pause and play again from AntennaPod pannel (this was needed in my case)
3. Pause and exit app.
4. Close app from app switcher
5. Open app and start at 1.
A new media control panel will appear with the last podcast played as the second panel.
Hope this helps to enable testing. I did not have to interact with the media control pannel of Andorid 11 besides making sure the episode is showing there,
@openpaul I confirmed that is a good way to replicate the problem
👀 I had like 20 of these things lingering on my phone. I'm firing up my debugger now to look at fixing
This issue has been mentioned on AntennaPod Forum. There might be relevant details there:
https://forum.antennapod.org/t/too-many-media-notifications-why/320/3
I'm no longer seeing this in 2.0.3 (f-droid) after the Nov 5th Android 11 update to my Pixel 4a. Only the currently playing or paused episode appears in the media controls now.
I have Android 11, Nov 5th and still can replicate this problem using @openpaul 's steps
I also have this issue. Happy to install debug builds, but I don't have a USB A-C cable to run logcat. I have a Pixel 3a, stock ROM, up-to-date.
I haven't been able to reproduce this since the December update (Android 11)
I also can not reproduce the issue anymore with the steps I proposed. This issue seems solved on Pixel 4a with latest updates.
AntennaPod version 2.0.3 (81e2be8f2)
Android patch level: 5. December 2020
Sadly, I still have the issue with latest playstore version 2.1.1 (pixel 2 up to date)
I tried to reboot, to start from a clean state with 0 media session, but every time I play a new episode they stack up in the panel
On pixel 2xl, still persisting for me as well.
On Fri, Jan 1, 2021, 11:31 AM Cédric Cabessa notifications@github.com
wrote:
Sadly, I still have the issue with latest playstore version 2.1.1 (pixel 2
up to date)I tried to reboot, to start from a clean state with 0 media session, but
every time I play a new episode they stack up in the panel—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/AntennaPod/AntennaPod/issues/4458#issuecomment-753348873,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/ADH4A2JMFGOUH5FNPMHMEJTSXYBFTANCNFSM4R44JEVA
.
With Android 11 4.9.232 update Jan 5, 2021 - this is no longer a problem.
@isabelgk what version of Android and AntennaPod are you on?
Ah, since I am on a Pixel 2 XL and it is no longer getting updates, I am on
the Android 11 October 20 2020 release. This might be the issue.
On Fri, Jan 8, 2021, 8:12 PM Tony Tam notifications@github.com wrote:
With Android 11 4.9.232 update Jan 5, 2021 - this is no longer a problem.
@isabelgk https://github.com/isabelgk what version of Android are you
on?—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/AntennaPod/AntennaPod/issues/4458#issuecomment-757078840,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/ADH4A2LBW2PFCXUVP547TQTSY63SNANCNFSM4R44JEVA
.
Most helpful comment
@openpaul I confirmed that is a good way to replicate the problem
👀 I had like 20 of these things lingering on my phone. I'm firing up my debugger now to look at fixing