Commit 513b301e by olly Committed by kim-vde

ExoPlaybackException: Align some method naming

PiperOrigin-RevId: 327003695
parent 7ef31e22
...@@ -204,7 +204,7 @@ public final class ExoPlaybackException extends Exception { ...@@ -204,7 +204,7 @@ public final class ExoPlaybackException extends Exception {
* @param cause The cause of the failure. * @param cause The cause of the failure.
* @return The created instance. * @return The created instance.
*/ */
public static ExoPlaybackException createForOutOfMemoryError(OutOfMemoryError cause) { public static ExoPlaybackException createForOutOfMemory(OutOfMemoryError cause) {
return new ExoPlaybackException(TYPE_OUT_OF_MEMORY, cause); return new ExoPlaybackException(TYPE_OUT_OF_MEMORY, cause);
} }
...@@ -215,7 +215,7 @@ public final class ExoPlaybackException extends Exception { ...@@ -215,7 +215,7 @@ public final class ExoPlaybackException extends Exception {
* @param timeoutOperation The operation that caused this timeout. * @param timeoutOperation The operation that caused this timeout.
* @return The created instance. * @return The created instance.
*/ */
public static ExoPlaybackException createForTimeoutError( public static ExoPlaybackException createForTimeout(
TimeoutException cause, @TimeoutOperation int timeoutOperation) { TimeoutException cause, @TimeoutOperation int timeoutOperation) {
return new ExoPlaybackException( return new ExoPlaybackException(
TYPE_OUT_OF_MEMORY, TYPE_OUT_OF_MEMORY,
...@@ -348,7 +348,7 @@ public final class ExoPlaybackException extends Exception { ...@@ -348,7 +348,7 @@ public final class ExoPlaybackException extends Exception {
* *
* @throws IllegalStateException If {@link #type} is not {@link #TYPE_TIMEOUT}. * @throws IllegalStateException If {@link #type} is not {@link #TYPE_TIMEOUT}.
*/ */
public TimeoutException getTimeoutError() { public TimeoutException getTimeoutException() {
Assertions.checkState(type == TYPE_TIMEOUT); Assertions.checkState(type == TYPE_TIMEOUT);
return (TimeoutException) Assertions.checkNotNull(cause); return (TimeoutException) Assertions.checkNotNull(cause);
} }
......
...@@ -683,7 +683,7 @@ import java.util.concurrent.TimeoutException; ...@@ -683,7 +683,7 @@ import java.util.concurrent.TimeoutException;
notifyListeners( notifyListeners(
listener -> listener ->
listener.onPlayerError( listener.onPlayerError(
ExoPlaybackException.createForTimeoutError( ExoPlaybackException.createForTimeout(
new TimeoutException("Setting foreground mode timed out."), new TimeoutException("Setting foreground mode timed out."),
ExoPlaybackException.TIMEOUT_OPERATION_SET_FOREGROUND_MODE))); ExoPlaybackException.TIMEOUT_OPERATION_SET_FOREGROUND_MODE)));
} }
...@@ -724,7 +724,7 @@ import java.util.concurrent.TimeoutException; ...@@ -724,7 +724,7 @@ import java.util.concurrent.TimeoutException;
notifyListeners( notifyListeners(
listener -> listener ->
listener.onPlayerError( listener.onPlayerError(
ExoPlaybackException.createForTimeoutError( ExoPlaybackException.createForTimeout(
new TimeoutException("Player release timed out."), new TimeoutException("Player release timed out."),
ExoPlaybackException.TIMEOUT_OPERATION_RELEASE))); ExoPlaybackException.TIMEOUT_OPERATION_RELEASE)));
} }
......
...@@ -557,7 +557,7 @@ import java.util.concurrent.atomic.AtomicBoolean; ...@@ -557,7 +557,7 @@ import java.util.concurrent.atomic.AtomicBoolean;
} catch (RuntimeException | OutOfMemoryError e) { } catch (RuntimeException | OutOfMemoryError e) {
ExoPlaybackException error = ExoPlaybackException error =
e instanceof OutOfMemoryError e instanceof OutOfMemoryError
? ExoPlaybackException.createForOutOfMemoryError((OutOfMemoryError) e) ? ExoPlaybackException.createForOutOfMemory((OutOfMemoryError) e)
: ExoPlaybackException.createForUnexpected((RuntimeException) e); : ExoPlaybackException.createForUnexpected((RuntimeException) e);
Log.e(TAG, "Playback error", error); Log.e(TAG, "Playback error", error);
stopInternal(/* forceResetRenderers= */ true, /* acknowledgeStop= */ false); stopInternal(/* forceResetRenderers= */ true, /* acknowledgeStop= */ false);
......
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