From aa23920e148191f36b4d9f9d1fd9924e13855762 Mon Sep 17 00:00:00 2001 From: ibaker Date: Thu, 19 Jan 2023 16:56:32 +0000 Subject: [PATCH] Explicitly document most Player.Listener methods in terms of getters This makes it implicitly clear that if the value of a getter changes due to a change in command availability then the listener will be invoked, without needing to explicitly document every command on every listener method. #minor-release PiperOrigin-RevId: 503178383 --- .../com/google/android/exoplayer2/Player.java | 51 +++++++++---------- 1 file changed, 23 insertions(+), 28 deletions(-) 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 7736a9652e..b65a3b8197 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 @@ -601,9 +601,15 @@ public interface Player { } /** - * Listener of all changes in the Player. + * Listener for changes in a {@link Player}. * *

All methods have no-op default implementations to allow selective overrides. + * + *

If the return value of a {@link Player} getter changes due to a change in {@linkplain + * #onAvailableCommandsChanged(Commands) command availability}, the corresponding listener + * method(s) will be invoked. If the return value of a {@link Player} getter does not change + * because the corresponding command is {@linkplain #onAvailableCommandsChanged(Commands) not + * available}, the corresponding listener method will not be invoked. */ interface Listener { @@ -613,9 +619,6 @@ public interface Player { *

State changes and events that happen within one {@link Looper} message queue iteration are * reported together and only after all individual callbacks were triggered. * - *

Only state changes represented by {@linkplain Event events} are reported through this - * method. - * *

Listeners should prefer this method over individual callbacks in the following cases: * *