Merge "Add error code to MediaCodec.CryptoException" into nyc-dev
am: b849eeab26
* commit 'b849eeab26a8635dbc3dc08127bfbbc7135fc47c':
Add error code to MediaCodec.CryptoException
This commit is contained in:
@@ -20384,6 +20384,7 @@ package android.media {
|
|||||||
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
|
field public static final int ERROR_SESSION_NOT_OPENED = 5; // 0x5
|
||||||
|
field public static final int ERROR_UNSUPPORTED_OPERATION = 6; // 0x6
|
||||||
}
|
}
|
||||||
|
|
||||||
public static final class MediaCodec.CryptoInfo {
|
public static final class MediaCodec.CryptoInfo {
|
||||||
|
|||||||
@@ -21876,6 +21876,7 @@ package android.media {
|
|||||||
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
|
field public static final int ERROR_SESSION_NOT_OPENED = 5; // 0x5
|
||||||
|
field public static final int ERROR_UNSUPPORTED_OPERATION = 6; // 0x6
|
||||||
}
|
}
|
||||||
|
|
||||||
public static final class MediaCodec.CryptoInfo {
|
public static final class MediaCodec.CryptoInfo {
|
||||||
|
|||||||
@@ -20395,6 +20395,7 @@ package android.media {
|
|||||||
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
|
field public static final int ERROR_SESSION_NOT_OPENED = 5; // 0x5
|
||||||
|
field public static final int ERROR_UNSUPPORTED_OPERATION = 6; // 0x6
|
||||||
}
|
}
|
||||||
|
|
||||||
public static final class MediaCodec.CryptoInfo {
|
public static final class MediaCodec.CryptoInfo {
|
||||||
|
|||||||
@@ -2074,6 +2074,16 @@ final public class MediaCodec {
|
|||||||
*/
|
*/
|
||||||
public static final int ERROR_SESSION_NOT_OPENED = 5;
|
public static final int ERROR_SESSION_NOT_OPENED = 5;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This indicates that an operation was attempted that could not be
|
||||||
|
* supported by the crypto system of the device in its current
|
||||||
|
* configuration. It may occur when the license policy requires
|
||||||
|
* device security features that aren't supported by the device,
|
||||||
|
* or due to an internal error in the crypto system that prevents
|
||||||
|
* the specified security policy from being met.
|
||||||
|
*/
|
||||||
|
public static final int ERROR_UNSUPPORTED_OPERATION = 6;
|
||||||
|
|
||||||
/** @hide */
|
/** @hide */
|
||||||
@IntDef({
|
@IntDef({
|
||||||
ERROR_NO_KEY,
|
ERROR_NO_KEY,
|
||||||
@@ -2081,6 +2091,7 @@ final public class MediaCodec {
|
|||||||
ERROR_RESOURCE_BUSY,
|
ERROR_RESOURCE_BUSY,
|
||||||
ERROR_INSUFFICIENT_OUTPUT_PROTECTION,
|
ERROR_INSUFFICIENT_OUTPUT_PROTECTION,
|
||||||
ERROR_SESSION_NOT_OPENED,
|
ERROR_SESSION_NOT_OPENED,
|
||||||
|
ERROR_UNSUPPORTED_OPERATION
|
||||||
})
|
})
|
||||||
@Retention(RetentionPolicy.SOURCE)
|
@Retention(RetentionPolicy.SOURCE)
|
||||||
public @interface CryptoErrorCode {}
|
public @interface CryptoErrorCode {}
|
||||||
|
|||||||
@@ -65,6 +65,7 @@ static struct CryptoErrorCodes {
|
|||||||
jint cryptoErrorResourceBusy;
|
jint cryptoErrorResourceBusy;
|
||||||
jint cryptoErrorInsufficientOutputProtection;
|
jint cryptoErrorInsufficientOutputProtection;
|
||||||
jint cryptoErrorSessionNotOpened;
|
jint cryptoErrorSessionNotOpened;
|
||||||
|
jint cryptoErrorUnsupportedOperation;
|
||||||
} gCryptoErrorCodes;
|
} gCryptoErrorCodes;
|
||||||
|
|
||||||
static struct CodecActionCodes {
|
static struct CodecActionCodes {
|
||||||
@@ -869,6 +870,10 @@ static void throwCryptoException(JNIEnv *env, status_t err, const char *msg) {
|
|||||||
err = gCryptoErrorCodes.cryptoErrorSessionNotOpened;
|
err = gCryptoErrorCodes.cryptoErrorSessionNotOpened;
|
||||||
defaultMsg = "Attempted to use a closed session";
|
defaultMsg = "Attempted to use a closed session";
|
||||||
break;
|
break;
|
||||||
|
case ERROR_DRM_CANNOT_HANDLE:
|
||||||
|
err = gCryptoErrorCodes.cryptoErrorUnsupportedOperation;
|
||||||
|
defaultMsg = "Operation not supported in this configuration";
|
||||||
|
break;
|
||||||
default: /* Other negative DRM error codes go out as is. */
|
default: /* Other negative DRM error codes go out as is. */
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -1773,6 +1778,11 @@ static void android_media_MediaCodec_native_init(JNIEnv *env) {
|
|||||||
gCryptoErrorCodes.cryptoErrorSessionNotOpened =
|
gCryptoErrorCodes.cryptoErrorSessionNotOpened =
|
||||||
env->GetStaticIntField(clazz.get(), field);
|
env->GetStaticIntField(clazz.get(), field);
|
||||||
|
|
||||||
|
field = env->GetStaticFieldID(clazz.get(), "ERROR_UNSUPPORTED_OPERATION", "I");
|
||||||
|
CHECK(field != NULL);
|
||||||
|
gCryptoErrorCodes.cryptoErrorUnsupportedOperation =
|
||||||
|
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