Exclude tracks from PlayerInfo if not changed

This change includes a change in the `IMediaController.aidl` file and needs
to provide backwards compatibility for when a client connects that is of an older or
newer version of the current service implementation.

This CL proposes to create a new AIDL method `onPlayerInfoChangedWithExtensions`
that is easier to extend in the future because it does use an `Bundle` rather than
primitives. A `Bundle` can be changed in a backward/forwards compatible way
in case we need further changes.

The compatibility handling is provided in `MediaSessionStub` and `MediaControllerStub`. The approach is not based on specific AIDL/Binder features but implemented fully in application code.

Issue: androidx/media#102
#minor-release
PiperOrigin-RevId: 490483068
(cherry picked from commit f262e9132b32ad89f65853086f30389925b61422)
This commit is contained in:
bachinger 2022-11-23 14:10:08 +00:00 committed by christosts
parent 989e2f71d3
commit 20e54a829d

View File

@ -674,7 +674,8 @@ public interface Player {
* to the current {@link #getRepeatMode() repeat mode}. * to the current {@link #getRepeatMode() repeat mode}.
* *
* <p>Note that this callback is also called when the playlist becomes non-empty or empty as a * <p>Note that this callback is also called when the playlist becomes non-empty or empty as a
* consequence of a playlist change. * consequence of a playlist change or {@linkplain #onAvailableCommandsChanged(Commands) a
* change in available commands}.
* *
* <p>{@link #onEvents(Player, Events)} will also be called to report this event along with * <p>{@link #onEvents(Player, Events)} will also be called to report this event along with
* other events that happen in the same {@link Looper} message queue iteration. * other events that happen in the same {@link Looper} message queue iteration.