Commit b689fbd4 by olly Committed by Oliver Woodman

Rename DecryptionException to CryptoException

PiperOrigin-RevId: 391272611
parent ce4c8e40
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
* Move `com.google.android.exoplayer2.device.DeviceInfo` to * Move `com.google.android.exoplayer2.device.DeviceInfo` to
`com.google.android.exoplayer2.DeviceInfo`. `com.google.android.exoplayer2.DeviceInfo`.
* Move `com.google.android.exoplayer2.drm.DecryptionException` to * Move `com.google.android.exoplayer2.drm.DecryptionException` to
`com.google.android.exoplayer2.decoder.DecryptionException`. `com.google.android.exoplayer2.decoder.CryptoException`.
* Make `ExoPlayer.Builder` return a `SimpleExoPlayer` instance. * Make `ExoPlayer.Builder` return a `SimpleExoPlayer` instance.
* Deprecate `SimpleExoPlayer.Builder`. Use `ExoPlayer.Builder` instead. * Deprecate `SimpleExoPlayer.Builder`. Use `ExoPlayer.Builder` instead.
* Android 12 compatibility: * Android 12 compatibility:
......
...@@ -21,9 +21,9 @@ import androidx.annotation.Nullable; ...@@ -21,9 +21,9 @@ import androidx.annotation.Nullable;
import androidx.annotation.VisibleForTesting; import androidx.annotation.VisibleForTesting;
import com.google.android.exoplayer2.C; import com.google.android.exoplayer2.C;
import com.google.android.exoplayer2.audio.OpusUtil; import com.google.android.exoplayer2.audio.OpusUtil;
import com.google.android.exoplayer2.decoder.CryptoException;
import com.google.android.exoplayer2.decoder.CryptoInfo; import com.google.android.exoplayer2.decoder.CryptoInfo;
import com.google.android.exoplayer2.decoder.DecoderInputBuffer; import com.google.android.exoplayer2.decoder.DecoderInputBuffer;
import com.google.android.exoplayer2.decoder.DecryptionException;
import com.google.android.exoplayer2.decoder.SimpleDecoder; import com.google.android.exoplayer2.decoder.SimpleDecoder;
import com.google.android.exoplayer2.decoder.SimpleOutputBuffer; import com.google.android.exoplayer2.decoder.SimpleOutputBuffer;
import com.google.android.exoplayer2.drm.ExoMediaCrypto; import com.google.android.exoplayer2.drm.ExoMediaCrypto;
...@@ -193,8 +193,8 @@ public final class OpusDecoder ...@@ -193,8 +193,8 @@ public final class OpusDecoder
if (result < 0) { if (result < 0) {
if (result == DRM_ERROR) { if (result == DRM_ERROR) {
String message = "Drm error: " + opusGetErrorMessage(nativeDecoderContext); String message = "Drm error: " + opusGetErrorMessage(nativeDecoderContext);
DecryptionException cause = CryptoException cause =
new DecryptionException(opusGetErrorCode(nativeDecoderContext), message); new CryptoException(opusGetErrorCode(nativeDecoderContext), message);
return new OpusDecoderException(message, cause); return new OpusDecoderException(message, cause);
} else { } else {
return new OpusDecoderException("Decode error: " + opusGetErrorMessage(result)); return new OpusDecoderException("Decode error: " + opusGetErrorMessage(result));
......
...@@ -21,9 +21,9 @@ import android.view.Surface; ...@@ -21,9 +21,9 @@ import android.view.Surface;
import androidx.annotation.Nullable; import androidx.annotation.Nullable;
import androidx.annotation.VisibleForTesting; import androidx.annotation.VisibleForTesting;
import com.google.android.exoplayer2.C; import com.google.android.exoplayer2.C;
import com.google.android.exoplayer2.decoder.CryptoException;
import com.google.android.exoplayer2.decoder.CryptoInfo; import com.google.android.exoplayer2.decoder.CryptoInfo;
import com.google.android.exoplayer2.decoder.DecoderInputBuffer; import com.google.android.exoplayer2.decoder.DecoderInputBuffer;
import com.google.android.exoplayer2.decoder.DecryptionException;
import com.google.android.exoplayer2.decoder.SimpleDecoder; import com.google.android.exoplayer2.decoder.SimpleDecoder;
import com.google.android.exoplayer2.drm.ExoMediaCrypto; import com.google.android.exoplayer2.drm.ExoMediaCrypto;
import com.google.android.exoplayer2.util.Assertions; import com.google.android.exoplayer2.util.Assertions;
...@@ -145,8 +145,7 @@ public final class VpxDecoder ...@@ -145,8 +145,7 @@ public final class VpxDecoder
if (result != NO_ERROR) { if (result != NO_ERROR) {
if (result == DRM_ERROR) { if (result == DRM_ERROR) {
String message = "Drm error: " + vpxGetErrorMessage(vpxDecContext); String message = "Drm error: " + vpxGetErrorMessage(vpxDecContext);
DecryptionException cause = CryptoException cause = new CryptoException(vpxGetErrorCode(vpxDecContext), message);
new DecryptionException(vpxGetErrorCode(vpxDecContext), message);
return new VpxDecoderException(message, cause); return new VpxDecoderException(message, cause);
} else { } else {
return new VpxDecoderException("Decode error: " + vpxGetErrorMessage(vpxDecContext)); return new VpxDecoderException("Decode error: " + vpxGetErrorMessage(vpxDecContext));
......
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
package com.google.android.exoplayer2.decoder; package com.google.android.exoplayer2.decoder;
/** Thrown when a non-platform component fails to decrypt data. */ /** Thrown when a non-platform component fails to decrypt data. */
public class DecryptionException extends Exception { public class CryptoException extends Exception {
/** A component specific error code. */ /** A component specific error code. */
public final int errorCode; public final int errorCode;
...@@ -25,7 +25,7 @@ public class DecryptionException extends Exception { ...@@ -25,7 +25,7 @@ public class DecryptionException extends Exception {
* @param errorCode A component specific error code. * @param errorCode A component specific error code.
* @param message The detail message. * @param message The detail message.
*/ */
public DecryptionException(int errorCode, String message) { public CryptoException(int errorCode, String message) {
super(message); super(message);
this.errorCode = errorCode; this.errorCode = errorCode;
} }
......
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