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 89b5dbff1c..4f3a454671 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 @@ -41,6 +41,7 @@ import com.google.common.base.Objects; import java.lang.annotation.Documented; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; +import java.util.ArrayList; import java.util.List; /** @@ -567,7 +568,7 @@ public interface Player { * *
Instances are immutable.
*/
- final class Commands {
+ final class Commands implements Bundleable {
/** A builder for {@link Commands} instances. */
public static final class Builder {
@@ -685,6 +686,46 @@ public interface Player {
public int hashCode() {
return flags.hashCode();
}
+
+ // Bundleable implementation.
+
+ @Documented
+ @Retention(RetentionPolicy.SOURCE)
+ @IntDef({FIELD_COMMANDS})
+ private @interface FieldNumber {}
+
+ private static final int FIELD_COMMANDS = 0;
+
+ @Override
+ public Bundle toBundle() {
+ Bundle bundle = new Bundle();
+ ArrayList