diff --git a/library/core/src/main/java/com/google/android/exoplayer2/ExoPlaybackException.java b/library/core/src/main/java/com/google/android/exoplayer2/ExoPlaybackException.java index efb78f1faf..4f22bbbe28 100644 --- a/library/core/src/main/java/com/google/android/exoplayer2/ExoPlaybackException.java +++ b/library/core/src/main/java/com/google/android/exoplayer2/ExoPlaybackException.java @@ -204,7 +204,7 @@ public final class ExoPlaybackException extends Exception { * @param cause The cause of the failure. * @return The created instance. */ - public static ExoPlaybackException createForOutOfMemoryError(OutOfMemoryError cause) { + public static ExoPlaybackException createForOutOfMemory(OutOfMemoryError cause) { return new ExoPlaybackException(TYPE_OUT_OF_MEMORY, cause); } @@ -215,7 +215,7 @@ public final class ExoPlaybackException extends Exception { * @param timeoutOperation The operation that caused this timeout. * @return The created instance. */ - public static ExoPlaybackException createForTimeoutError( + public static ExoPlaybackException createForTimeout( TimeoutException cause, @TimeoutOperation int timeoutOperation) { return new ExoPlaybackException( TYPE_OUT_OF_MEMORY, @@ -348,7 +348,7 @@ public final class ExoPlaybackException extends Exception { * * @throws IllegalStateException If {@link #type} is not {@link #TYPE_TIMEOUT}. */ - public TimeoutException getTimeoutError() { + public TimeoutException getTimeoutException() { Assertions.checkState(type == TYPE_TIMEOUT); return (TimeoutException) Assertions.checkNotNull(cause); } diff --git a/library/core/src/main/java/com/google/android/exoplayer2/ExoPlayerImpl.java b/library/core/src/main/java/com/google/android/exoplayer2/ExoPlayerImpl.java index 88e436eb56..76be46eb40 100644 --- a/library/core/src/main/java/com/google/android/exoplayer2/ExoPlayerImpl.java +++ b/library/core/src/main/java/com/google/android/exoplayer2/ExoPlayerImpl.java @@ -683,7 +683,7 @@ import java.util.concurrent.TimeoutException; notifyListeners( listener -> listener.onPlayerError( - ExoPlaybackException.createForTimeoutError( + ExoPlaybackException.createForTimeout( new TimeoutException("Setting foreground mode timed out."), ExoPlaybackException.TIMEOUT_OPERATION_SET_FOREGROUND_MODE))); } @@ -724,7 +724,7 @@ import java.util.concurrent.TimeoutException; notifyListeners( listener -> listener.onPlayerError( - ExoPlaybackException.createForTimeoutError( + ExoPlaybackException.createForTimeout( new TimeoutException("Player release timed out."), ExoPlaybackException.TIMEOUT_OPERATION_RELEASE))); } diff --git a/library/core/src/main/java/com/google/android/exoplayer2/ExoPlayerImplInternal.java b/library/core/src/main/java/com/google/android/exoplayer2/ExoPlayerImplInternal.java index 9a0587e22a..77637f1ef0 100644 --- a/library/core/src/main/java/com/google/android/exoplayer2/ExoPlayerImplInternal.java +++ b/library/core/src/main/java/com/google/android/exoplayer2/ExoPlayerImplInternal.java @@ -557,7 +557,7 @@ import java.util.concurrent.atomic.AtomicBoolean; } catch (RuntimeException | OutOfMemoryError e) { ExoPlaybackException error = e instanceof OutOfMemoryError - ? ExoPlaybackException.createForOutOfMemoryError((OutOfMemoryError) e) + ? ExoPlaybackException.createForOutOfMemory((OutOfMemoryError) e) : ExoPlaybackException.createForUnexpected((RuntimeException) e); Log.e(TAG, "Playback error", error); stopInternal(/* forceResetRenderers= */ true, /* acknowledgeStop= */ false);