android / uamp

A sample audio app for Android
Apache License 2.0
13.06k stars 3.74k forks source link

Crash on MediaLibraryService when swiping up app (media3 branch) #541

Open kelmer44 opened 4 months ago

kelmer44 commented 4 months ago

If you follow these steps:

  1. Start playing
  2. Pause (from app or media notification)
  3. Swipe up app

occassionally the app will crash with the following log line

2024-02-20 13:52:47.813 mediaserver          mediaserver           E  unlinkToDeath: removed reference to death recipient but unlink failed: DEAD_OBJECT
2024-02-20 13:52:47.813 IPCThreadState       mediaserver           E  attemptIncStrongHandle(28): Not supported

Looks like the process is being restarted due to this crash, and this leaves the media notification in place with a useless set of actions; clicking any action yields nothing.

When checking the MediaButtonReceiver from the media_session like so:

adb shell dumpsys media_session | grep MediaButtonReceiver we see this:

Last MediaButtonReceiver: MBR {pi=null, componentName=ComponentInfo{com.example.android.uamp.next/androidx.media.session.MediaButtonReceiver}, type=1, pkg=com.example.android.uamp.next}

(no pending intent)

I'm also experiencing this issue in my app and its a pretty bad scenario, any ideas?