am c1e0e38e: am 5ece42b9: am 105633d9: am 6826b25c: Merge "Report specific exception type on decrypt with invalid session" into mnc-dev
* commit 'c1e0e38ea84cf850d25e0051a9792efc87ac5e3a': Report specific exception type on decrypt with invalid session
This commit is contained in:
@@ -15401,6 +15401,7 @@ package android.media {
|
|||||||
field public static final int ERROR_KEY_EXPIRED = 2; // 0x2
|
field public static final int ERROR_KEY_EXPIRED = 2; // 0x2
|
||||||
field public static final int ERROR_NO_KEY = 1; // 0x1
|
field public static final int ERROR_NO_KEY = 1; // 0x1
|
||||||
field public static final int ERROR_RESOURCE_BUSY = 3; // 0x3
|
field public static final int ERROR_RESOURCE_BUSY = 3; // 0x3
|
||||||
|
field public static final int ERROR_SESSION_NOT_OPENED = 5; // 0x5
|
||||||
}
|
}
|
||||||
|
|
||||||
public static final class MediaCodec.CryptoInfo {
|
public static final class MediaCodec.CryptoInfo {
|
||||||
|
|||||||
@@ -16664,6 +16664,7 @@ package android.media {
|
|||||||
field public static final int ERROR_KEY_EXPIRED = 2; // 0x2
|
field public static final int ERROR_KEY_EXPIRED = 2; // 0x2
|
||||||
field public static final int ERROR_NO_KEY = 1; // 0x1
|
field public static final int ERROR_NO_KEY = 1; // 0x1
|
||||||
field public static final int ERROR_RESOURCE_BUSY = 3; // 0x3
|
field public static final int ERROR_RESOURCE_BUSY = 3; // 0x3
|
||||||
|
field public static final int ERROR_SESSION_NOT_OPENED = 5; // 0x5
|
||||||
}
|
}
|
||||||
|
|
||||||
public static final class MediaCodec.CryptoInfo {
|
public static final class MediaCodec.CryptoInfo {
|
||||||
|
|||||||
@@ -2029,12 +2029,21 @@ final public class MediaCodec {
|
|||||||
*/
|
*/
|
||||||
public static final int ERROR_INSUFFICIENT_OUTPUT_PROTECTION = 4;
|
public static final int ERROR_INSUFFICIENT_OUTPUT_PROTECTION = 4;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This indicates that decryption was attempted on a session that is
|
||||||
|
* not opened, which could be due to a failure to open the session,
|
||||||
|
* closing the session prematurely, or the session being reclaimed
|
||||||
|
* by the resource manager.
|
||||||
|
*/
|
||||||
|
public static final int ERROR_SESSION_NOT_OPENED = 5;
|
||||||
|
|
||||||
/** @hide */
|
/** @hide */
|
||||||
@IntDef({
|
@IntDef({
|
||||||
ERROR_NO_KEY,
|
ERROR_NO_KEY,
|
||||||
ERROR_KEY_EXPIRED,
|
ERROR_KEY_EXPIRED,
|
||||||
ERROR_RESOURCE_BUSY,
|
ERROR_RESOURCE_BUSY,
|
||||||
ERROR_INSUFFICIENT_OUTPUT_PROTECTION,
|
ERROR_INSUFFICIENT_OUTPUT_PROTECTION,
|
||||||
|
ERROR_SESSION_NOT_OPENED,
|
||||||
})
|
})
|
||||||
@Retention(RetentionPolicy.SOURCE)
|
@Retention(RetentionPolicy.SOURCE)
|
||||||
public @interface CryptoErrorCode {}
|
public @interface CryptoErrorCode {}
|
||||||
|
|||||||
@@ -64,6 +64,7 @@ static struct CryptoErrorCodes {
|
|||||||
jint cryptoErrorKeyExpired;
|
jint cryptoErrorKeyExpired;
|
||||||
jint cryptoErrorResourceBusy;
|
jint cryptoErrorResourceBusy;
|
||||||
jint cryptoErrorInsufficientOutputProtection;
|
jint cryptoErrorInsufficientOutputProtection;
|
||||||
|
jint cryptoErrorSessionNotOpened;
|
||||||
} gCryptoErrorCodes;
|
} gCryptoErrorCodes;
|
||||||
|
|
||||||
static struct CodecActionCodes {
|
static struct CodecActionCodes {
|
||||||
@@ -843,6 +844,9 @@ static void throwCryptoException(JNIEnv *env, status_t err, const char *msg) {
|
|||||||
case ERROR_DRM_INSUFFICIENT_OUTPUT_PROTECTION:
|
case ERROR_DRM_INSUFFICIENT_OUTPUT_PROTECTION:
|
||||||
err = gCryptoErrorCodes.cryptoErrorInsufficientOutputProtection;
|
err = gCryptoErrorCodes.cryptoErrorInsufficientOutputProtection;
|
||||||
break;
|
break;
|
||||||
|
case ERROR_DRM_SESSION_NOT_OPENED:
|
||||||
|
err = gCryptoErrorCodes.cryptoErrorSessionNotOpened;
|
||||||
|
break;
|
||||||
default: /* Other negative DRM error codes go out as is. */
|
default: /* Other negative DRM error codes go out as is. */
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -1689,6 +1693,11 @@ static void android_media_MediaCodec_native_init(JNIEnv *env) {
|
|||||||
gCryptoErrorCodes.cryptoErrorInsufficientOutputProtection =
|
gCryptoErrorCodes.cryptoErrorInsufficientOutputProtection =
|
||||||
env->GetStaticIntField(clazz.get(), field);
|
env->GetStaticIntField(clazz.get(), field);
|
||||||
|
|
||||||
|
field = env->GetStaticFieldID(clazz.get(), "ERROR_SESSION_NOT_OPENED", "I");
|
||||||
|
CHECK(field != NULL);
|
||||||
|
gCryptoErrorCodes.cryptoErrorSessionNotOpened =
|
||||||
|
env->GetStaticIntField(clazz.get(), field);
|
||||||
|
|
||||||
clazz.reset(env->FindClass("android/media/MediaCodec$CodecException"));
|
clazz.reset(env->FindClass("android/media/MediaCodec$CodecException"));
|
||||||
CHECK(clazz.get() != NULL);
|
CHECK(clazz.get() != NULL);
|
||||||
field = env->GetStaticFieldID(clazz.get(), "ACTION_TRANSIENT", "I");
|
field = env->GetStaticFieldID(clazz.get(), "ACTION_TRANSIENT", "I");
|
||||||
|
|||||||
Reference in New Issue
Block a user