AntennaPod/playback
hades 84b6f442fc
Fix android auto resume on reconnect issues (#7156)
Previously the MediaSession object created in PlaybackService in onCreate would
be completely empty. This seemed to confuse Android Auto, and prevented it from
restarting playback.

Filling the MediaSession object using the data from the player state at
onCreate resolves this problem.

This is documented in Android Auto docs[1], albeit indirectly and somewhat
confusingly.

Also move the setSessionToken call to the end of onCreate handler to ensure
that the media session has already been completely filled by the time the
session token is made available to the framework. There is no evidence that
this is required; however intuitively, this is likely the trigger for the
framework to start querying the media session.

The change was tested both with Desktop Head Unit and with a real vehicle.

[1] https://developer.android.com/training/cars/media/#initial-playback-state
2024-05-18 19:34:36 +02:00
..
base CI tweaks (#7069) 2024-04-07 23:28:14 +02:00
cast Rename FeedMedia methods to no longer have underscores (#7017) 2024-03-23 11:27:55 +01:00
service Fix android auto resume on reconnect issues (#7156) 2024-05-18 19:34:36 +02:00
README.md Chromecast rework (#5518) 2021-11-28 22:19:14 +01:00

README.md

:playback

This folder contains modules that deal with media playback.