这是indexloc提供的服务,不要输入任何密码
Skip to content

ANR and Crash in the absence of PlaybackResumption support (Android 11 and bellow) #2543

@vladikadiroff

Description

@vladikadiroff

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

  1. Run demo-session project
  2. Play any video
  3. Pause video
  4. Open Settings -> Apps & notifications -> Media3 Session Demo
  5. Click "Force Stop"
  6. 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 )
  7. 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

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions