From 20e54a829debdad34c5959a69fb84891ba4fe408 Mon Sep 17 00:00:00 2001 From: bachinger Date: Wed, 23 Nov 2022 14:10:08 +0000 Subject: [PATCH] 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) --- .../src/main/java/com/google/android/exoplayer2/Player.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/library/common/src/main/java/com/google/android/exoplayer2/Player.java b/library/common/src/main/java/com/google/android/exoplayer2/Player.java index a8fa9873f6..f26e033ce4 100644 --- a/library/common/src/main/java/com/google/android/exoplayer2/Player.java +++ b/library/common/src/main/java/com/google/android/exoplayer2/Player.java @@ -674,7 +674,8 @@ public interface Player { * to the current {@link #getRepeatMode() repeat mode}. * *

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}. * *

{@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.