Fixed spelling across various PlayerInfo *ChangeReason fields
PiperOrigin-RevId: 541892788
This commit is contained in:
parent
e0191ddded
commit
b9cc70d9e2
@ -2559,7 +2559,7 @@ import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
/* eventFlag= */ Player.EVENT_PLAY_WHEN_READY_CHANGED,
|
||||
listener ->
|
||||
listener.onPlayWhenReadyChanged(
|
||||
finalPlayerInfo.playWhenReady, finalPlayerInfo.playWhenReadyChangedReason));
|
||||
finalPlayerInfo.playWhenReady, finalPlayerInfo.playWhenReadyChangeReason));
|
||||
}
|
||||
if (oldPlayerInfo.playbackSuppressionReason != finalPlayerInfo.playbackSuppressionReason) {
|
||||
listeners.queueEvent(
|
||||
|
@ -2240,7 +2240,7 @@ import org.checkerframework.checker.initialization.qual.UnderInitialization;
|
||||
/* deviceVolume= */ deviceVolume,
|
||||
/* deviceMuted= */ deviceMuted,
|
||||
/* playWhenReady= */ playWhenReady,
|
||||
/* playWhenReadyChangedReason= */ PlayerInfo.PLAY_WHEN_READY_CHANGE_REASON_DEFAULT,
|
||||
/* playWhenReadyChangeReason= */ PlayerInfo.PLAY_WHEN_READY_CHANGE_REASON_DEFAULT,
|
||||
/* playbackSuppressionReason= */ Player.PLAYBACK_SUPPRESSION_REASON_NONE,
|
||||
/* playbackState= */ playbackState,
|
||||
/* isPlaying= */ isPlaying,
|
||||
|
@ -930,7 +930,7 @@ import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
|
||||
session.playerInfo =
|
||||
session.playerInfo.copyWithPlayWhenReady(
|
||||
session.playerInfo.playWhenReady,
|
||||
session.playerInfo.playWhenReadyChangedReason,
|
||||
session.playerInfo.playWhenReadyChangeReason,
|
||||
reason);
|
||||
session.onPlayerInfoChangedHandler.sendPlayerInfoChangedMessage(
|
||||
/* excludeTimeline= */ true, /* excludeTracks= */ true);
|
||||
|
@ -137,7 +137,7 @@ import com.google.errorprone.annotations.CanIgnoreReturnValue;
|
||||
private int deviceVolume;
|
||||
private boolean deviceMuted;
|
||||
private boolean playWhenReady;
|
||||
private @Player.PlayWhenReadyChangeReason int playWhenReadyChangedReason;
|
||||
private @Player.PlayWhenReadyChangeReason int playWhenReadyChangeReason;
|
||||
private boolean isPlaying;
|
||||
private boolean isLoading;
|
||||
private @PlaybackSuppressionReason int playbackSuppressionReason;
|
||||
@ -169,7 +169,7 @@ import com.google.errorprone.annotations.CanIgnoreReturnValue;
|
||||
deviceVolume = playerInfo.deviceVolume;
|
||||
deviceMuted = playerInfo.deviceMuted;
|
||||
playWhenReady = playerInfo.playWhenReady;
|
||||
playWhenReadyChangedReason = playerInfo.playWhenReadyChangedReason;
|
||||
playWhenReadyChangeReason = playerInfo.playWhenReadyChangeReason;
|
||||
isPlaying = playerInfo.isPlaying;
|
||||
isLoading = playerInfo.isLoading;
|
||||
playbackSuppressionReason = playerInfo.playbackSuppressionReason;
|
||||
@ -298,9 +298,9 @@ import com.google.errorprone.annotations.CanIgnoreReturnValue;
|
||||
}
|
||||
|
||||
@CanIgnoreReturnValue
|
||||
public Builder setPlayWhenReadyChangedReason(
|
||||
@Player.PlayWhenReadyChangeReason int playWhenReadyChangedReason) {
|
||||
this.playWhenReadyChangedReason = playWhenReadyChangedReason;
|
||||
public Builder setPlayWhenReadyChangeReason(
|
||||
@Player.PlayWhenReadyChangeReason int playWhenReadyChangeReason) {
|
||||
this.playWhenReadyChangeReason = playWhenReadyChangeReason;
|
||||
return this;
|
||||
}
|
||||
|
||||
@ -389,7 +389,7 @@ import com.google.errorprone.annotations.CanIgnoreReturnValue;
|
||||
deviceVolume,
|
||||
deviceMuted,
|
||||
playWhenReady,
|
||||
playWhenReadyChangedReason,
|
||||
playWhenReadyChangeReason,
|
||||
playbackSuppressionReason,
|
||||
playbackState,
|
||||
isPlaying,
|
||||
@ -485,7 +485,7 @@ import com.google.errorprone.annotations.CanIgnoreReturnValue;
|
||||
|
||||
public final boolean playWhenReady;
|
||||
|
||||
public final int playWhenReadyChangedReason;
|
||||
public final int playWhenReadyChangeReason;
|
||||
|
||||
public final boolean isPlaying;
|
||||
|
||||
@ -510,11 +510,11 @@ import com.google.errorprone.annotations.CanIgnoreReturnValue;
|
||||
@CheckResult
|
||||
public PlayerInfo copyWithPlayWhenReady(
|
||||
boolean playWhenReady,
|
||||
@Player.PlayWhenReadyChangeReason int playWhenReadyChangedReason,
|
||||
@Player.PlayWhenReadyChangeReason int playWhenReadyChangeReason,
|
||||
@Player.PlaybackSuppressionReason int playbackSuppressionReason) {
|
||||
return new Builder(this)
|
||||
.setPlayWhenReady(playWhenReady)
|
||||
.setPlayWhenReadyChangedReason(playWhenReadyChangedReason)
|
||||
.setPlayWhenReadyChangeReason(playWhenReadyChangeReason)
|
||||
.setPlaybackSuppressionReason(playbackSuppressionReason)
|
||||
.setIsPlaying(isPlaying(playbackState, playWhenReady, playbackSuppressionReason))
|
||||
.build();
|
||||
@ -704,7 +704,7 @@ import com.google.errorprone.annotations.CanIgnoreReturnValue;
|
||||
int deviceVolume,
|
||||
boolean deviceMuted,
|
||||
boolean playWhenReady,
|
||||
@Player.PlayWhenReadyChangeReason int playWhenReadyChangedReason,
|
||||
@Player.PlayWhenReadyChangeReason int playWhenReadyChangeReason,
|
||||
@Player.PlaybackSuppressionReason int playbackSuppressionReason,
|
||||
@Player.State int playbackState,
|
||||
boolean isPlaying,
|
||||
@ -734,7 +734,7 @@ import com.google.errorprone.annotations.CanIgnoreReturnValue;
|
||||
this.deviceVolume = deviceVolume;
|
||||
this.deviceMuted = deviceMuted;
|
||||
this.playWhenReady = playWhenReady;
|
||||
this.playWhenReadyChangedReason = playWhenReadyChangedReason;
|
||||
this.playWhenReadyChangeReason = playWhenReadyChangeReason;
|
||||
this.playbackSuppressionReason = playbackSuppressionReason;
|
||||
this.playbackState = playbackState;
|
||||
this.isPlaying = isPlaying;
|
||||
@ -778,7 +778,7 @@ import com.google.errorprone.annotations.CanIgnoreReturnValue;
|
||||
private static final String FIELD_DEVICE_VOLUME = Util.intToStringMaxRadix(10);
|
||||
private static final String FIELD_DEVICE_MUTED = Util.intToStringMaxRadix(11);
|
||||
private static final String FIELD_PLAY_WHEN_READY = Util.intToStringMaxRadix(12);
|
||||
private static final String FIELD_PLAY_WHEN_READY_CHANGED_REASON = Util.intToStringMaxRadix(13);
|
||||
private static final String FIELD_PLAY_WHEN_READY_CHANGE_REASON = Util.intToStringMaxRadix(13);
|
||||
private static final String FIELD_PLAYBACK_SUPPRESSION_REASON = Util.intToStringMaxRadix(14);
|
||||
private static final String FIELD_PLAYBACK_STATE = Util.intToStringMaxRadix(15);
|
||||
private static final String FIELD_IS_PLAYING = Util.intToStringMaxRadix(16);
|
||||
@ -938,9 +938,9 @@ import com.google.errorprone.annotations.CanIgnoreReturnValue;
|
||||
int deviceVolume = bundle.getInt(FIELD_DEVICE_VOLUME, /* defaultValue= */ 0);
|
||||
boolean deviceMuted = bundle.getBoolean(FIELD_DEVICE_MUTED, /* defaultValue= */ false);
|
||||
boolean playWhenReady = bundle.getBoolean(FIELD_PLAY_WHEN_READY, /* defaultValue= */ false);
|
||||
int playWhenReadyChangedReason =
|
||||
int playWhenReadyChangeReason =
|
||||
bundle.getInt(
|
||||
FIELD_PLAY_WHEN_READY_CHANGED_REASON,
|
||||
FIELD_PLAY_WHEN_READY_CHANGE_REASON,
|
||||
/* defaultValue= */ PLAY_WHEN_READY_CHANGE_REASON_USER_REQUEST);
|
||||
@Player.PlaybackSuppressionReason
|
||||
int playbackSuppressionReason =
|
||||
@ -990,7 +990,7 @@ import com.google.errorprone.annotations.CanIgnoreReturnValue;
|
||||
deviceVolume,
|
||||
deviceMuted,
|
||||
playWhenReady,
|
||||
playWhenReadyChangedReason,
|
||||
playWhenReadyChangeReason,
|
||||
playbackSuppressionReason,
|
||||
playbackState,
|
||||
isPlaying,
|
||||
|
@ -150,7 +150,7 @@ public class PlayerInfoTest {
|
||||
new PlaybackException(
|
||||
/* message= */ null, /* cause= */ null, PlaybackException.ERROR_CODE_TIMEOUT))
|
||||
.setPlayWhenReady(true)
|
||||
.setPlayWhenReadyChangedReason(Player.PLAY_WHEN_READY_CHANGE_REASON_USER_REQUEST)
|
||||
.setPlayWhenReadyChangeReason(Player.PLAY_WHEN_READY_CHANGE_REASON_USER_REQUEST)
|
||||
.setRepeatMode(Player.REPEAT_MODE_ONE)
|
||||
.setSeekBackIncrement(7000)
|
||||
.setSeekForwardIncrement(6000)
|
||||
@ -225,7 +225,7 @@ public class PlayerInfoTest {
|
||||
assertThat(infoAfterBundling.playerError.errorCode)
|
||||
.isEqualTo(PlaybackException.ERROR_CODE_TIMEOUT);
|
||||
assertThat(infoAfterBundling.playWhenReady).isTrue();
|
||||
assertThat(infoAfterBundling.playWhenReadyChangedReason)
|
||||
assertThat(infoAfterBundling.playWhenReadyChangeReason)
|
||||
.isEqualTo(Player.PLAY_WHEN_READY_CHANGE_REASON_USER_REQUEST);
|
||||
assertThat(infoAfterBundling.repeatMode).isEqualTo(Player.REPEAT_MODE_ONE);
|
||||
assertThat(infoAfterBundling.seekBackIncrementMs).isEqualTo(7000);
|
||||
|
@ -722,7 +722,7 @@ public class MediaControllerStateMaskingWithMediaSessionCompatTest {
|
||||
MediaController controller = controllerTestRule.createController(session.getSessionToken());
|
||||
CountDownLatch latch = new CountDownLatch(2);
|
||||
AtomicReference<Timeline> timelineFromParamRef = new AtomicReference<>();
|
||||
AtomicInteger timelineChangedReasonRef = new AtomicInteger();
|
||||
AtomicInteger timelineChangeReasonRef = new AtomicInteger();
|
||||
AtomicReference<Player.Events> onEventsRef = new AtomicReference<>();
|
||||
Player.Listener listener =
|
||||
new Player.Listener() {
|
||||
@ -730,7 +730,7 @@ public class MediaControllerStateMaskingWithMediaSessionCompatTest {
|
||||
public void onTimelineChanged(
|
||||
Timeline timeline, @Player.TimelineChangeReason int reason) {
|
||||
timelineFromParamRef.set(timeline);
|
||||
timelineChangedReasonRef.set(reason);
|
||||
timelineChangeReasonRef.set(reason);
|
||||
latch.countDown();
|
||||
}
|
||||
|
||||
@ -757,7 +757,7 @@ public class MediaControllerStateMaskingWithMediaSessionCompatTest {
|
||||
|
||||
assertThat(latch.await(TIMEOUT_MS, MILLISECONDS)).isTrue();
|
||||
MediaTestUtils.assertTimelineContains(timelineFromParamRef.get(), testMediaItems);
|
||||
assertThat(timelineChangedReasonRef.get()).isEqualTo(TIMELINE_CHANGE_REASON_PLAYLIST_CHANGED);
|
||||
assertThat(timelineChangeReasonRef.get()).isEqualTo(TIMELINE_CHANGE_REASON_PLAYLIST_CHANGED);
|
||||
assertThat(onEventsRef.get()).isEqualTo(testEvents);
|
||||
assertThat(currentMediaItemIndexRef.get()).isEqualTo(testCurrentMediaItemIndex);
|
||||
assertThat(currentMediaItemRef.get()).isEqualTo(testCurrentMediaItem);
|
||||
@ -789,7 +789,7 @@ public class MediaControllerStateMaskingWithMediaSessionCompatTest {
|
||||
MediaController controller = controllerTestRule.createController(session.getSessionToken());
|
||||
CountDownLatch latch = new CountDownLatch(2);
|
||||
AtomicReference<Timeline> timelineFromParamRef = new AtomicReference<>();
|
||||
AtomicInteger timelineChangedReasonRef = new AtomicInteger();
|
||||
AtomicInteger timelineChangeReasonRef = new AtomicInteger();
|
||||
AtomicReference<Player.Events> onEventsRef = new AtomicReference<>();
|
||||
Player.Listener listener =
|
||||
new Player.Listener() {
|
||||
@ -797,7 +797,7 @@ public class MediaControllerStateMaskingWithMediaSessionCompatTest {
|
||||
public void onTimelineChanged(
|
||||
Timeline timeline, @Player.TimelineChangeReason int reason) {
|
||||
timelineFromParamRef.set(timeline);
|
||||
timelineChangedReasonRef.set(reason);
|
||||
timelineChangeReasonRef.set(reason);
|
||||
latch.countDown();
|
||||
}
|
||||
|
||||
@ -824,7 +824,7 @@ public class MediaControllerStateMaskingWithMediaSessionCompatTest {
|
||||
|
||||
assertThat(latch.await(TIMEOUT_MS, MILLISECONDS)).isTrue();
|
||||
MediaTestUtils.assertTimelineContains(timelineFromParamRef.get(), testMediaItems);
|
||||
assertThat(timelineChangedReasonRef.get()).isEqualTo(TIMELINE_CHANGE_REASON_PLAYLIST_CHANGED);
|
||||
assertThat(timelineChangeReasonRef.get()).isEqualTo(TIMELINE_CHANGE_REASON_PLAYLIST_CHANGED);
|
||||
assertThat(onEventsRef.get()).isEqualTo(testEvents);
|
||||
assertThat(currentMediaItemIndexRef.get()).isEqualTo(testCurrentMediaItemIndex);
|
||||
assertThat(currentMediaItemRef.get()).isEqualTo(testCurrentMediaItem);
|
||||
@ -853,7 +853,7 @@ public class MediaControllerStateMaskingWithMediaSessionCompatTest {
|
||||
MediaController controller = controllerTestRule.createController(session.getSessionToken());
|
||||
CountDownLatch latch = new CountDownLatch(2);
|
||||
AtomicReference<Timeline> timelineFromParamRef = new AtomicReference<>();
|
||||
AtomicInteger timelineChangedReasonRef = new AtomicInteger();
|
||||
AtomicInteger timelineChangeReasonRef = new AtomicInteger();
|
||||
AtomicReference<Player.Events> onEventsRef = new AtomicReference<>();
|
||||
Player.Listener listener =
|
||||
new Player.Listener() {
|
||||
@ -861,7 +861,7 @@ public class MediaControllerStateMaskingWithMediaSessionCompatTest {
|
||||
public void onTimelineChanged(
|
||||
Timeline timeline, @Player.TimelineChangeReason int reason) {
|
||||
timelineFromParamRef.set(timeline);
|
||||
timelineChangedReasonRef.set(reason);
|
||||
timelineChangeReasonRef.set(reason);
|
||||
latch.countDown();
|
||||
}
|
||||
|
||||
@ -888,7 +888,7 @@ public class MediaControllerStateMaskingWithMediaSessionCompatTest {
|
||||
|
||||
assertThat(latch.await(TIMEOUT_MS, MILLISECONDS)).isTrue();
|
||||
MediaTestUtils.assertTimelineContains(timelineFromParamRef.get(), testMediaItems);
|
||||
assertThat(timelineChangedReasonRef.get()).isEqualTo(TIMELINE_CHANGE_REASON_PLAYLIST_CHANGED);
|
||||
assertThat(timelineChangeReasonRef.get()).isEqualTo(TIMELINE_CHANGE_REASON_PLAYLIST_CHANGED);
|
||||
assertThat(onEventsRef.get()).isEqualTo(testEvents);
|
||||
assertThat(currentMediaItemIndexRef.get()).isEqualTo(testCurrentMediaItemIndex);
|
||||
assertThat(currentMediaItemRef.get()).isEqualTo(testCurrentMediaItem);
|
||||
@ -919,7 +919,7 @@ public class MediaControllerStateMaskingWithMediaSessionCompatTest {
|
||||
MediaController controller = controllerTestRule.createController(session.getSessionToken());
|
||||
CountDownLatch latch = new CountDownLatch(2);
|
||||
AtomicReference<Timeline> timelineFromParamRef = new AtomicReference<>();
|
||||
AtomicInteger timelineChangedReasonRef = new AtomicInteger();
|
||||
AtomicInteger timelineChangeReasonRef = new AtomicInteger();
|
||||
AtomicReference<Player.Events> onEventsRef = new AtomicReference<>();
|
||||
Player.Listener listener =
|
||||
new Player.Listener() {
|
||||
@ -927,7 +927,7 @@ public class MediaControllerStateMaskingWithMediaSessionCompatTest {
|
||||
public void onTimelineChanged(
|
||||
Timeline timeline, @Player.TimelineChangeReason int reason) {
|
||||
timelineFromParamRef.set(timeline);
|
||||
timelineChangedReasonRef.set(reason);
|
||||
timelineChangeReasonRef.set(reason);
|
||||
latch.countDown();
|
||||
}
|
||||
|
||||
@ -954,7 +954,7 @@ public class MediaControllerStateMaskingWithMediaSessionCompatTest {
|
||||
|
||||
assertThat(latch.await(TIMEOUT_MS, MILLISECONDS)).isTrue();
|
||||
MediaTestUtils.assertTimelineContains(timelineFromParamRef.get(), testMediaItems);
|
||||
assertThat(timelineChangedReasonRef.get()).isEqualTo(TIMELINE_CHANGE_REASON_PLAYLIST_CHANGED);
|
||||
assertThat(timelineChangeReasonRef.get()).isEqualTo(TIMELINE_CHANGE_REASON_PLAYLIST_CHANGED);
|
||||
assertThat(onEventsRef.get()).isEqualTo(testEvents);
|
||||
assertThat(currentMediaItemIndexRef.get()).isEqualTo(testCurrentMediaItemIndex);
|
||||
assertThat(currentMediaItemRef.get()).isEqualTo(testCurrentMediaItem);
|
||||
@ -984,7 +984,7 @@ public class MediaControllerStateMaskingWithMediaSessionCompatTest {
|
||||
MediaController controller = controllerTestRule.createController(session.getSessionToken());
|
||||
CountDownLatch latch = new CountDownLatch(2);
|
||||
AtomicReference<Timeline> timelineFromParamRef = new AtomicReference<>();
|
||||
AtomicInteger timelineChangedReasonRef = new AtomicInteger();
|
||||
AtomicInteger timelineChangeReasonRef = new AtomicInteger();
|
||||
AtomicReference<Player.Events> onEventsRef = new AtomicReference<>();
|
||||
Player.Listener listener =
|
||||
new Player.Listener() {
|
||||
@ -992,7 +992,7 @@ public class MediaControllerStateMaskingWithMediaSessionCompatTest {
|
||||
public void onTimelineChanged(
|
||||
Timeline timeline, @Player.TimelineChangeReason int reason) {
|
||||
timelineFromParamRef.set(timeline);
|
||||
timelineChangedReasonRef.set(reason);
|
||||
timelineChangeReasonRef.set(reason);
|
||||
latch.countDown();
|
||||
}
|
||||
|
||||
@ -1017,7 +1017,7 @@ public class MediaControllerStateMaskingWithMediaSessionCompatTest {
|
||||
|
||||
assertThat(latch.await(TIMEOUT_MS, MILLISECONDS)).isTrue();
|
||||
MediaTestUtils.assertTimelineContains(timelineFromParamRef.get(), testMediaItems);
|
||||
assertThat(timelineChangedReasonRef.get()).isEqualTo(TIMELINE_CHANGE_REASON_PLAYLIST_CHANGED);
|
||||
assertThat(timelineChangeReasonRef.get()).isEqualTo(TIMELINE_CHANGE_REASON_PLAYLIST_CHANGED);
|
||||
assertThat(onEventsRef.get()).isEqualTo(testEvents);
|
||||
assertThat(currentMediaItemIndexRef.get()).isEqualTo(testCurrentMediaItemIndex);
|
||||
MediaTestUtils.assertTimelineContains(timelineFromGetterRef.get(), testMediaItems);
|
||||
@ -1046,7 +1046,7 @@ public class MediaControllerStateMaskingWithMediaSessionCompatTest {
|
||||
MediaController controller = controllerTestRule.createController(session.getSessionToken());
|
||||
CountDownLatch latch = new CountDownLatch(2);
|
||||
AtomicReference<Timeline> timelineFromParamRef = new AtomicReference<>();
|
||||
AtomicInteger timelineChangedReasonRef = new AtomicInteger();
|
||||
AtomicInteger timelineChangeReasonRef = new AtomicInteger();
|
||||
AtomicReference<Player.Events> onEventsRef = new AtomicReference<>();
|
||||
Player.Listener listener =
|
||||
new Player.Listener() {
|
||||
@ -1054,7 +1054,7 @@ public class MediaControllerStateMaskingWithMediaSessionCompatTest {
|
||||
public void onTimelineChanged(
|
||||
Timeline timeline, @Player.TimelineChangeReason int reason) {
|
||||
timelineFromParamRef.set(timeline);
|
||||
timelineChangedReasonRef.set(reason);
|
||||
timelineChangeReasonRef.set(reason);
|
||||
latch.countDown();
|
||||
}
|
||||
|
||||
@ -1081,7 +1081,7 @@ public class MediaControllerStateMaskingWithMediaSessionCompatTest {
|
||||
|
||||
assertThat(latch.await(TIMEOUT_MS, MILLISECONDS)).isTrue();
|
||||
MediaTestUtils.assertTimelineContains(timelineFromParamRef.get(), testMediaItems);
|
||||
assertThat(timelineChangedReasonRef.get()).isEqualTo(TIMELINE_CHANGE_REASON_PLAYLIST_CHANGED);
|
||||
assertThat(timelineChangeReasonRef.get()).isEqualTo(TIMELINE_CHANGE_REASON_PLAYLIST_CHANGED);
|
||||
assertThat(onEventsRef.get()).isEqualTo(testEvents);
|
||||
assertThat(currentMediaItemIndexRef.get()).isEqualTo(testCurrentMediaItemIndex);
|
||||
assertThat(currentMediaItemRef.get()).isEqualTo(testCurrentMediaItem);
|
||||
@ -1113,7 +1113,7 @@ public class MediaControllerStateMaskingWithMediaSessionCompatTest {
|
||||
MediaController controller = controllerTestRule.createController(session.getSessionToken());
|
||||
CountDownLatch latch = new CountDownLatch(2);
|
||||
AtomicReference<Timeline> timelineFromParamRef = new AtomicReference<>();
|
||||
AtomicInteger timelineChangedReasonRef = new AtomicInteger();
|
||||
AtomicInteger timelineChangeReasonRef = new AtomicInteger();
|
||||
AtomicReference<Player.Events> onEventsRef = new AtomicReference<>();
|
||||
Player.Listener listener =
|
||||
new Player.Listener() {
|
||||
@ -1121,7 +1121,7 @@ public class MediaControllerStateMaskingWithMediaSessionCompatTest {
|
||||
public void onTimelineChanged(
|
||||
Timeline timeline, @Player.TimelineChangeReason int reason) {
|
||||
timelineFromParamRef.set(timeline);
|
||||
timelineChangedReasonRef.set(reason);
|
||||
timelineChangeReasonRef.set(reason);
|
||||
latch.countDown();
|
||||
}
|
||||
|
||||
@ -1146,7 +1146,7 @@ public class MediaControllerStateMaskingWithMediaSessionCompatTest {
|
||||
|
||||
assertThat(latch.await(TIMEOUT_MS, MILLISECONDS)).isTrue();
|
||||
MediaTestUtils.assertTimelineContains(timelineFromParamRef.get(), testMediaItems);
|
||||
assertThat(timelineChangedReasonRef.get()).isEqualTo(TIMELINE_CHANGE_REASON_PLAYLIST_CHANGED);
|
||||
assertThat(timelineChangeReasonRef.get()).isEqualTo(TIMELINE_CHANGE_REASON_PLAYLIST_CHANGED);
|
||||
assertThat(onEventsRef.get()).isEqualTo(testEvents);
|
||||
assertThat(currentMediaItemIndexRef.get()).isEqualTo(testCurrentMediaItemIndex);
|
||||
MediaTestUtils.assertTimelineContains(timelineFromGetterRef.get(), testMediaItems);
|
||||
@ -1331,7 +1331,7 @@ public class MediaControllerStateMaskingWithMediaSessionCompatTest {
|
||||
MediaController controller = controllerTestRule.createController(session.getSessionToken());
|
||||
CountDownLatch latch = new CountDownLatch(3); // 2x onTimelineChanged + onEvents
|
||||
AtomicReference<Timeline> timelineFromParamRef = new AtomicReference<>();
|
||||
AtomicInteger timelineChangedReasonRef = new AtomicInteger();
|
||||
AtomicInteger timelineChangeReasonRef = new AtomicInteger();
|
||||
AtomicReference<Player.Events> onEventsRef = new AtomicReference<>();
|
||||
Player.Listener listener =
|
||||
new Player.Listener() {
|
||||
@ -1339,7 +1339,7 @@ public class MediaControllerStateMaskingWithMediaSessionCompatTest {
|
||||
public void onTimelineChanged(
|
||||
Timeline timeline, @Player.TimelineChangeReason int reason) {
|
||||
timelineFromParamRef.set(timeline);
|
||||
timelineChangedReasonRef.set(reason);
|
||||
timelineChangeReasonRef.set(reason);
|
||||
latch.countDown();
|
||||
}
|
||||
|
||||
@ -1366,7 +1366,7 @@ public class MediaControllerStateMaskingWithMediaSessionCompatTest {
|
||||
|
||||
assertThat(latch.await(TIMEOUT_MS, MILLISECONDS)).isTrue();
|
||||
MediaTestUtils.assertTimelineContains(timelineFromParamRef.get(), expectedMediaItems);
|
||||
assertThat(timelineChangedReasonRef.get()).isEqualTo(TIMELINE_CHANGE_REASON_PLAYLIST_CHANGED);
|
||||
assertThat(timelineChangeReasonRef.get()).isEqualTo(TIMELINE_CHANGE_REASON_PLAYLIST_CHANGED);
|
||||
assertThat(onEventsRef.get()).isEqualTo(expectedEvents);
|
||||
assertThat(currentMediaItemIndexRef.get()).isEqualTo(3);
|
||||
assertThat(currentMediaItemRef.get()).isEqualTo(testCurrentMediaItem);
|
||||
@ -1395,7 +1395,7 @@ public class MediaControllerStateMaskingWithMediaSessionCompatTest {
|
||||
MediaController controller = controllerTestRule.createController(session.getSessionToken());
|
||||
CountDownLatch latch = new CountDownLatch(3); // 2x onTimelineChanged + onEvents
|
||||
AtomicReference<Timeline> timelineFromParamRef = new AtomicReference<>();
|
||||
AtomicInteger timelineChangedReasonRef = new AtomicInteger();
|
||||
AtomicInteger timelineChangeReasonRef = new AtomicInteger();
|
||||
AtomicReference<Player.Events> onEventsRef = new AtomicReference<>();
|
||||
Player.Listener listener =
|
||||
new Player.Listener() {
|
||||
@ -1403,7 +1403,7 @@ public class MediaControllerStateMaskingWithMediaSessionCompatTest {
|
||||
public void onTimelineChanged(
|
||||
Timeline timeline, @Player.TimelineChangeReason int reason) {
|
||||
timelineFromParamRef.set(timeline);
|
||||
timelineChangedReasonRef.set(reason);
|
||||
timelineChangeReasonRef.set(reason);
|
||||
latch.countDown();
|
||||
}
|
||||
|
||||
@ -1430,7 +1430,7 @@ public class MediaControllerStateMaskingWithMediaSessionCompatTest {
|
||||
|
||||
assertThat(latch.await(TIMEOUT_MS, MILLISECONDS)).isTrue();
|
||||
MediaTestUtils.assertTimelineContains(timelineFromParamRef.get(), expectedMediaItems);
|
||||
assertThat(timelineChangedReasonRef.get()).isEqualTo(TIMELINE_CHANGE_REASON_PLAYLIST_CHANGED);
|
||||
assertThat(timelineChangeReasonRef.get()).isEqualTo(TIMELINE_CHANGE_REASON_PLAYLIST_CHANGED);
|
||||
assertThat(onEventsRef.get()).isEqualTo(expectedEvents);
|
||||
assertThat(currentMediaItemIndexRef.get()).isEqualTo(1);
|
||||
assertThat(currentMediaItemRef.get()).isEqualTo(newMediaItems.get(0));
|
||||
@ -1458,7 +1458,7 @@ public class MediaControllerStateMaskingWithMediaSessionCompatTest {
|
||||
MediaController controller = controllerTestRule.createController(session.getSessionToken());
|
||||
CountDownLatch latch = new CountDownLatch(2);
|
||||
AtomicReference<Timeline> timelineFromParamRef = new AtomicReference<>();
|
||||
AtomicInteger timelineChangedReasonRef = new AtomicInteger();
|
||||
AtomicInteger timelineChangeReasonRef = new AtomicInteger();
|
||||
AtomicReference<Player.Events> onEventsRef = new AtomicReference<>();
|
||||
Player.Listener listener =
|
||||
new Player.Listener() {
|
||||
@ -1466,7 +1466,7 @@ public class MediaControllerStateMaskingWithMediaSessionCompatTest {
|
||||
public void onTimelineChanged(
|
||||
Timeline timeline, @Player.TimelineChangeReason int reason) {
|
||||
timelineFromParamRef.set(timeline);
|
||||
timelineChangedReasonRef.set(reason);
|
||||
timelineChangeReasonRef.set(reason);
|
||||
latch.countDown();
|
||||
}
|
||||
|
||||
@ -1494,7 +1494,7 @@ public class MediaControllerStateMaskingWithMediaSessionCompatTest {
|
||||
|
||||
assertThat(latch.await(TIMEOUT_MS, MILLISECONDS)).isTrue();
|
||||
MediaTestUtils.assertTimelineContains(timelineFromParamRef.get(), expectedMediaItems);
|
||||
assertThat(timelineChangedReasonRef.get()).isEqualTo(TIMELINE_CHANGE_REASON_PLAYLIST_CHANGED);
|
||||
assertThat(timelineChangeReasonRef.get()).isEqualTo(TIMELINE_CHANGE_REASON_PLAYLIST_CHANGED);
|
||||
assertThat(onEventsRef.get()).isEqualTo(expectedEvents);
|
||||
assertThat(currentMediaItemIndexRef.get()).isEqualTo(1);
|
||||
assertThat(currentMediaItemRef.get()).isEqualTo(expectedMediaItems.get(1));
|
||||
@ -1522,7 +1522,7 @@ public class MediaControllerStateMaskingWithMediaSessionCompatTest {
|
||||
MediaController controller = controllerTestRule.createController(session.getSessionToken());
|
||||
CountDownLatch latch = new CountDownLatch(2);
|
||||
AtomicReference<Timeline> timelineFromParamRef = new AtomicReference<>();
|
||||
AtomicInteger timelineChangedReasonRef = new AtomicInteger();
|
||||
AtomicInteger timelineChangeReasonRef = new AtomicInteger();
|
||||
AtomicReference<Player.Events> onEventsRef = new AtomicReference<>();
|
||||
Player.Listener listener =
|
||||
new Player.Listener() {
|
||||
@ -1530,7 +1530,7 @@ public class MediaControllerStateMaskingWithMediaSessionCompatTest {
|
||||
public void onTimelineChanged(
|
||||
Timeline timeline, @Player.TimelineChangeReason int reason) {
|
||||
timelineFromParamRef.set(timeline);
|
||||
timelineChangedReasonRef.set(reason);
|
||||
timelineChangeReasonRef.set(reason);
|
||||
latch.countDown();
|
||||
}
|
||||
|
||||
@ -1558,7 +1558,7 @@ public class MediaControllerStateMaskingWithMediaSessionCompatTest {
|
||||
|
||||
assertThat(latch.await(TIMEOUT_MS, MILLISECONDS)).isTrue();
|
||||
MediaTestUtils.assertTimelineContains(timelineFromParamRef.get(), expectedMediaItems);
|
||||
assertThat(timelineChangedReasonRef.get()).isEqualTo(TIMELINE_CHANGE_REASON_PLAYLIST_CHANGED);
|
||||
assertThat(timelineChangeReasonRef.get()).isEqualTo(TIMELINE_CHANGE_REASON_PLAYLIST_CHANGED);
|
||||
assertThat(onEventsRef.get()).isEqualTo(expectedEvents);
|
||||
assertThat(currentMediaItemIndexRef.get()).isEqualTo(0);
|
||||
assertThat(currentMediaItemRef.get()).isEqualTo(expectedMediaItems.get(0));
|
||||
@ -1579,7 +1579,7 @@ public class MediaControllerStateMaskingWithMediaSessionCompatTest {
|
||||
MediaController controller = controllerTestRule.createController(session.getSessionToken());
|
||||
CountDownLatch latch = new CountDownLatch(2);
|
||||
AtomicReference<Timeline> timelineFromParamRef = new AtomicReference<>();
|
||||
AtomicInteger timelineChangedReasonRef = new AtomicInteger();
|
||||
AtomicInteger timelineChangeReasonRef = new AtomicInteger();
|
||||
AtomicReference<Player.Events> onEventsRef = new AtomicReference<>();
|
||||
Player.Listener listener =
|
||||
new Player.Listener() {
|
||||
@ -1587,7 +1587,7 @@ public class MediaControllerStateMaskingWithMediaSessionCompatTest {
|
||||
public void onTimelineChanged(
|
||||
Timeline timeline, @Player.TimelineChangeReason int reason) {
|
||||
timelineFromParamRef.set(timeline);
|
||||
timelineChangedReasonRef.set(reason);
|
||||
timelineChangeReasonRef.set(reason);
|
||||
latch.countDown();
|
||||
}
|
||||
|
||||
@ -1614,7 +1614,7 @@ public class MediaControllerStateMaskingWithMediaSessionCompatTest {
|
||||
|
||||
assertThat(latch.await(TIMEOUT_MS, MILLISECONDS)).isTrue();
|
||||
MediaTestUtils.assertTimelineContains(timelineFromParamRef.get(), newMediaItems);
|
||||
assertThat(timelineChangedReasonRef.get()).isEqualTo(TIMELINE_CHANGE_REASON_PLAYLIST_CHANGED);
|
||||
assertThat(timelineChangeReasonRef.get()).isEqualTo(TIMELINE_CHANGE_REASON_PLAYLIST_CHANGED);
|
||||
assertThat(onEventsRef.get()).isEqualTo(expectedEvents);
|
||||
assertThat(currentMediaItemIndexRef.get()).isEqualTo(0);
|
||||
assertThat(currentMediaItemRef.get()).isEqualTo(newMediaItems.get(0));
|
||||
@ -1642,7 +1642,7 @@ public class MediaControllerStateMaskingWithMediaSessionCompatTest {
|
||||
MediaController controller = controllerTestRule.createController(session.getSessionToken());
|
||||
CountDownLatch latch = new CountDownLatch(3);
|
||||
AtomicReference<Timeline> timelineFromParamRef = new AtomicReference<>();
|
||||
AtomicInteger timelineChangedReasonRef = new AtomicInteger();
|
||||
AtomicInteger timelineChangeReasonRef = new AtomicInteger();
|
||||
AtomicReference<Player.Events> onEventsRef = new AtomicReference<>();
|
||||
Player.Listener listener =
|
||||
new Player.Listener() {
|
||||
@ -1650,7 +1650,7 @@ public class MediaControllerStateMaskingWithMediaSessionCompatTest {
|
||||
public void onTimelineChanged(
|
||||
Timeline timeline, @Player.TimelineChangeReason int reason) {
|
||||
timelineFromParamRef.set(timeline);
|
||||
timelineChangedReasonRef.set(reason);
|
||||
timelineChangeReasonRef.set(reason);
|
||||
latch.countDown();
|
||||
}
|
||||
|
||||
@ -1677,7 +1677,7 @@ public class MediaControllerStateMaskingWithMediaSessionCompatTest {
|
||||
|
||||
assertThat(latch.await(TIMEOUT_MS, MILLISECONDS)).isTrue();
|
||||
MediaTestUtils.assertTimelineContains(timelineFromParamRef.get(), expectedMediaItems);
|
||||
assertThat(timelineChangedReasonRef.get()).isEqualTo(TIMELINE_CHANGE_REASON_PLAYLIST_CHANGED);
|
||||
assertThat(timelineChangeReasonRef.get()).isEqualTo(TIMELINE_CHANGE_REASON_PLAYLIST_CHANGED);
|
||||
assertThat(onEventsRef.get()).isEqualTo(expectedEvents);
|
||||
assertThat(currentMediaItemIndexRef.get()).isEqualTo(1);
|
||||
assertThat(currentMediaItemRef.get()).isEqualTo(newMediaItems.get(0));
|
||||
|
@ -1349,7 +1349,7 @@ public class MediaControllerWithMediaSessionCompatTest {
|
||||
CountDownLatch latch = new CountDownLatch(1);
|
||||
AtomicBoolean playWhenReadyFromParamRef = new AtomicBoolean();
|
||||
AtomicBoolean playWhenReadyFromGetterRef = new AtomicBoolean();
|
||||
AtomicInteger playWhenReadyChangedReasonFromParamRef = new AtomicInteger();
|
||||
AtomicInteger playWhenReadyChangeReasonFromParamRef = new AtomicInteger();
|
||||
Player.Listener listener =
|
||||
new Player.Listener() {
|
||||
@Override
|
||||
@ -1357,7 +1357,7 @@ public class MediaControllerWithMediaSessionCompatTest {
|
||||
boolean playWhenReady, @Player.PlayWhenReadyChangeReason int reason) {
|
||||
playWhenReadyFromParamRef.set(playWhenReady);
|
||||
playWhenReadyFromGetterRef.set(controller.getPlayWhenReady());
|
||||
playWhenReadyChangedReasonFromParamRef.set(reason);
|
||||
playWhenReadyChangeReasonFromParamRef.set(reason);
|
||||
latch.countDown();
|
||||
}
|
||||
};
|
||||
@ -1371,7 +1371,7 @@ public class MediaControllerWithMediaSessionCompatTest {
|
||||
assertThat(latch.await(TIMEOUT_MS, MILLISECONDS)).isTrue();
|
||||
assertThat(playWhenReadyFromParamRef.get()).isEqualTo(testPlayWhenReady);
|
||||
assertThat(playWhenReadyFromGetterRef.get()).isEqualTo(testPlayWhenReady);
|
||||
assertThat(playWhenReadyChangedReasonFromParamRef.get())
|
||||
assertThat(playWhenReadyChangeReasonFromParamRef.get())
|
||||
.isEqualTo(Player.PLAY_WHEN_READY_CHANGE_REASON_REMOTE);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user