Commit 72b416c6 by aquilescanta Committed by Oliver Woodman

Remove ExoPlaybackException factory method that doesn't take errorCode

PiperOrigin-RevId: 384442821
parent cdaf3e4e
...@@ -56,6 +56,7 @@ import com.google.ads.interactivemedia.v3.api.player.VideoAdPlayer; ...@@ -56,6 +56,7 @@ import com.google.ads.interactivemedia.v3.api.player.VideoAdPlayer;
import com.google.ads.interactivemedia.v3.api.player.VideoProgressUpdate; import com.google.ads.interactivemedia.v3.api.player.VideoProgressUpdate;
import com.google.android.exoplayer2.C; import com.google.android.exoplayer2.C;
import com.google.android.exoplayer2.ExoPlaybackException; import com.google.android.exoplayer2.ExoPlaybackException;
import com.google.android.exoplayer2.PlaybackException;
import com.google.android.exoplayer2.Player; import com.google.android.exoplayer2.Player;
import com.google.android.exoplayer2.Timeline; import com.google.android.exoplayer2.Timeline;
import com.google.android.exoplayer2.Timeline.Period; import com.google.android.exoplayer2.Timeline.Period;
...@@ -273,7 +274,9 @@ public final class ImaAdsLoaderTest { ...@@ -273,7 +274,9 @@ public final class ImaAdsLoaderTest {
adEventListener.onAdEvent(getAdEvent(AdEventType.STARTED, mockPrerollSingleAd)); adEventListener.onAdEvent(getAdEvent(AdEventType.STARTED, mockPrerollSingleAd));
videoAdPlayer.pauseAd(TEST_AD_MEDIA_INFO); videoAdPlayer.pauseAd(TEST_AD_MEDIA_INFO);
videoAdPlayer.stopAd(TEST_AD_MEDIA_INFO); videoAdPlayer.stopAd(TEST_AD_MEDIA_INFO);
ExoPlaybackException anException = ExoPlaybackException.createForSource(new IOException()); ExoPlaybackException anException =
ExoPlaybackException.createForSource(
new IOException(), PlaybackException.ERROR_CODE_IO_UNSPECIFIED);
imaAdsLoader.onPlayerErrorChanged(anException); imaAdsLoader.onPlayerErrorChanged(anException);
imaAdsLoader.onPlayerError(anException); imaAdsLoader.onPlayerError(anException);
imaAdsLoader.onPositionDiscontinuity( imaAdsLoader.onPositionDiscontinuity(
......
...@@ -104,16 +104,6 @@ public final class ExoPlaybackException extends PlaybackException { ...@@ -104,16 +104,6 @@ public final class ExoPlaybackException extends PlaybackException {
* Creates an instance of type {@link #TYPE_SOURCE}. * Creates an instance of type {@link #TYPE_SOURCE}.
* *
* @param cause The cause of the failure. * @param cause The cause of the failure.
* @return The created instance.
*/
public static ExoPlaybackException createForSource(IOException cause) {
return createForSource(cause, ERROR_CODE_UNSPECIFIED);
}
/**
* Creates an instance of type {@link #TYPE_SOURCE}.
*
* @param cause The cause of the failure.
* @param errorCode See {@link #errorCode}. * @param errorCode See {@link #errorCode}.
* @return The created instance. * @return The created instance.
*/ */
......
...@@ -1674,7 +1674,9 @@ public final class ExoPlayerTest { ...@@ -1674,7 +1674,9 @@ public final class ExoPlayerTest {
ActionSchedule actionSchedule = ActionSchedule actionSchedule =
new ActionSchedule.Builder(TAG) new ActionSchedule.Builder(TAG)
.waitForPlaybackState(Player.STATE_READY) .waitForPlaybackState(Player.STATE_READY)
.throwPlaybackException(ExoPlaybackException.createForSource(new IOException())) .throwPlaybackException(
ExoPlaybackException.createForSource(
new IOException(), PlaybackException.ERROR_CODE_IO_UNSPECIFIED))
.waitForPlaybackState(Player.STATE_IDLE) .waitForPlaybackState(Player.STATE_IDLE)
.prepare() .prepare()
.waitForPlaybackState(Player.STATE_BUFFERING) .waitForPlaybackState(Player.STATE_BUFFERING)
...@@ -1709,7 +1711,8 @@ public final class ExoPlayerTest { ...@@ -1709,7 +1711,8 @@ public final class ExoPlayerTest {
player player
.createMessage( .createMessage(
(type, payload) -> { (type, payload) -> {
throw ExoPlaybackException.createForSource(new IOException()); throw ExoPlaybackException.createForSource(
new IOException(), PlaybackException.ERROR_CODE_IO_UNSPECIFIED);
}) })
.send(); .send();
TestPlayerRunHelper.runUntilError(player); TestPlayerRunHelper.runUntilError(player);
...@@ -1784,7 +1787,9 @@ public final class ExoPlayerTest { ...@@ -1784,7 +1787,9 @@ public final class ExoPlayerTest {
.pause() .pause()
.waitForPlaybackState(Player.STATE_READY) .waitForPlaybackState(Player.STATE_READY)
.playUntilPosition(/* windowIndex= */ 1, /* positionMs= */ 500) .playUntilPosition(/* windowIndex= */ 1, /* positionMs= */ 500)
.throwPlaybackException(ExoPlaybackException.createForSource(new IOException())) .throwPlaybackException(
ExoPlaybackException.createForSource(
new IOException(), PlaybackException.ERROR_CODE_IO_UNSPECIFIED))
.waitForPlaybackState(Player.STATE_IDLE) .waitForPlaybackState(Player.STATE_IDLE)
.executeRunnable( .executeRunnable(
new PlayerRunnable() { new PlayerRunnable() {
...@@ -1847,7 +1852,9 @@ public final class ExoPlayerTest { ...@@ -1847,7 +1852,9 @@ public final class ExoPlayerTest {
.pause() .pause()
.waitForPlaybackState(Player.STATE_READY) .waitForPlaybackState(Player.STATE_READY)
.playUntilPosition(/* windowIndex= */ 1, /* positionMs= */ 500) .playUntilPosition(/* windowIndex= */ 1, /* positionMs= */ 500)
.throwPlaybackException(ExoPlaybackException.createForSource(new IOException())) .throwPlaybackException(
ExoPlaybackException.createForSource(
new IOException(), PlaybackException.ERROR_CODE_IO_UNSPECIFIED))
.waitForPlaybackState(Player.STATE_IDLE) .waitForPlaybackState(Player.STATE_IDLE)
.executeRunnable( .executeRunnable(
new PlayerRunnable() { new PlayerRunnable() {
...@@ -1909,7 +1916,9 @@ public final class ExoPlayerTest { ...@@ -1909,7 +1916,9 @@ public final class ExoPlayerTest {
new ActionSchedule.Builder(TAG) new ActionSchedule.Builder(TAG)
.pause() .pause()
.waitForPlaybackState(Player.STATE_READY) .waitForPlaybackState(Player.STATE_READY)
.throwPlaybackException(ExoPlaybackException.createForSource(new IOException())) .throwPlaybackException(
ExoPlaybackException.createForSource(
new IOException(), PlaybackException.ERROR_CODE_IO_UNSPECIFIED))
.waitForPlaybackState(Player.STATE_IDLE) .waitForPlaybackState(Player.STATE_IDLE)
.seek(0, C.TIME_UNSET) .seek(0, C.TIME_UNSET)
.prepare() .prepare()
...@@ -1958,12 +1967,16 @@ public final class ExoPlayerTest { ...@@ -1958,12 +1967,16 @@ public final class ExoPlayerTest {
new ActionSchedule.Builder(TAG) new ActionSchedule.Builder(TAG)
.pause() .pause()
.waitForPlaybackState(Player.STATE_READY) .waitForPlaybackState(Player.STATE_READY)
.throwPlaybackException(ExoPlaybackException.createForSource(new IOException())) .throwPlaybackException(
ExoPlaybackException.createForSource(
new IOException(), PlaybackException.ERROR_CODE_IO_UNSPECIFIED))
.waitForPlaybackState(Player.STATE_IDLE) .waitForPlaybackState(Player.STATE_IDLE)
.setMediaSources(/* resetPosition= */ false, mediaSource2) .setMediaSources(/* resetPosition= */ false, mediaSource2)
.prepare() .prepare()
.waitForPlaybackState(Player.STATE_BUFFERING) .waitForPlaybackState(Player.STATE_BUFFERING)
.throwPlaybackException(ExoPlaybackException.createForSource(new IOException())) .throwPlaybackException(
ExoPlaybackException.createForSource(
new IOException(), PlaybackException.ERROR_CODE_IO_UNSPECIFIED))
.waitForTimelineChanged(timeline, Player.TIMELINE_CHANGE_REASON_SOURCE_UPDATE) .waitForTimelineChanged(timeline, Player.TIMELINE_CHANGE_REASON_SOURCE_UPDATE)
.waitForPlaybackState(Player.STATE_IDLE) .waitForPlaybackState(Player.STATE_IDLE)
.build(); .build();
......
...@@ -731,7 +731,9 @@ public final class AnalyticsCollectorTest { ...@@ -731,7 +731,9 @@ public final class AnalyticsCollectorTest {
new ActionSchedule.Builder(TAG) new ActionSchedule.Builder(TAG)
.pause() .pause()
.waitForPlaybackState(Player.STATE_READY) .waitForPlaybackState(Player.STATE_READY)
.throwPlaybackException(ExoPlaybackException.createForSource(new IOException())) .throwPlaybackException(
ExoPlaybackException.createForSource(
new IOException(), PlaybackException.ERROR_CODE_IO_UNSPECIFIED))
.waitForPlaybackState(Player.STATE_IDLE) .waitForPlaybackState(Player.STATE_IDLE)
.seek(/* positionMs= */ 0) .seek(/* positionMs= */ 0)
.prepare() .prepare()
...@@ -1958,7 +1960,9 @@ public final class AnalyticsCollectorTest { ...@@ -1958,7 +1960,9 @@ public final class AnalyticsCollectorTest {
analyticsCollector.addListener(listener2); analyticsCollector.addListener(listener2);
analyticsCollector.addListener(listener3); analyticsCollector.addListener(listener3);
analyticsCollector.onPlayerError(ExoPlaybackException.createForSource(new IOException())); analyticsCollector.onPlayerError(
ExoPlaybackException.createForSource(
new IOException(), PlaybackException.ERROR_CODE_IO_UNSPECIFIED));
InOrder inOrder = Mockito.inOrder(listener1, listener2, listener3); InOrder inOrder = Mockito.inOrder(listener1, listener2, listener3);
inOrder.verify(listener1).onPlayerError(any(), any()); inOrder.verify(listener1).onPlayerError(any(), any());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment