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

Media resumption doesn't work if prepare() was called in onCreate() #2578

@nift4

Description

@nift4

Version

Media3 main branch

More version details

bb5da94

Devices that reproduce the issue

All devices

Devices that do not reproduce the issue

N/A

Reproducible in the demo app?

Not tested

Reproduction steps

  1. add prepare() to onCreate()
  2. Reboot device
  3. SystemUI will try to query for playback resumption

Expected result

Media resumption notification shows up.

Actual result

It doesn't show up, because media resumption code relied on the assumption that if no media controller sends any commands, the player will stay in STATE_IDLE. This optimization however breaks if a developer calls prepare() in or shortly after (in my case, which caused this to be a race).

See 2ac334e for a proposed fix (and more details), and #2458 (comment) for more context.

Media

N/A

Bug Report

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions