ANR and Crash in the absence of PlaybackResumption support (Android 11 and bellow)
Open
@marcbaechinger is already working on this.
Since Jun 20, 2025.
wont fix: intended behavior
- Dominant language
- Java
- Stars
- 3k
- Forks
- 955
- Avg merge
- 12d 14h
- Merged PRs (30d)
- 2
Description
Version
Media3 main branch
More version details
1.6.x
1.5.x
etc
Devices that reproduce the issue
Devices with Android 11 and below
Devices that do not reproduce the issue
Devices with Android 12+
Reproducible in the demo app?
Yes
Reproduction steps
- Run demo-session project
- Play any video
- Pause video
- Open Settings -> Apps & notifications -> Media3 Session Demo
- Click "Force Stop"
- Send media session play event (for example, press the play button on the headset or invoke a command via ADB -
adb shell input keyevent 85) - See logcat: Crash And ANR
Expected result
ANR and Crash
FATAL EXCEPTION: main
Process: androidx.media3.demo.session, PID: 16226
android.app.RemoteServiceException: Context.startForegroundService() did not then call Service.startForeground(): ServiceRecord{6363728 u0 androidx.media3.demo.session/.PlaybackService}
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2005)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:223)
at android.app.ActivityThread.main(ActivityThread.java:7656)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947)
ANR in androidx.media3.demo.session
PID: 16226
Reason: Context.startForegroundService() did not then call Service.startForeground(): ServiceRecord{6363728 u0 androidx.media3.demo.session/.PlaybackService}
Actual result
ANR and Сrash are absent.
Media
Any media from the demo-session project
Bug Report
- You will email the zip file produced by
adb bugreportto android-media-github@google.com after filing this issue.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.