From 41afb6ac4e6b99cad324da095dfdc062ee45174b Mon Sep 17 00:00:00 2001 From: krocard Date: Wed, 19 May 2021 10:06:53 +0100 Subject: [PATCH] Add guarantied invalid command to allow niche optimisations This allows users to use `int` to store an optional command. PiperOrigin-RevId: 374600127 --- .../src/main/java/com/google/android/exoplayer2/Player.java | 4 ++++ 1 file changed, 4 insertions(+) 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 898737ef28..12ba2e1cab 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 @@ -1097,6 +1097,7 @@ public interface Player { @Documented @Retention(RetentionPolicy.SOURCE) @IntDef({ + COMMAND_INVALID, COMMAND_PLAY_PAUSE, COMMAND_PREPARE_STOP, COMMAND_SEEK_TO_DEFAULT_POSITION, @@ -1169,6 +1170,9 @@ public interface Player { /** Command to get the text that should currently be displayed by the player. */ int COMMAND_GET_TEXT = 23; + /** Represents an invalid {@link Command}. */ + int COMMAND_INVALID = -1; + /** * Returns the {@link Looper} associated with the application thread that's used to access the * player and on which player events are received.