Commit b689fbd4 by olly Committed by Oliver Woodman

Rename DecryptionException to CryptoException

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