diff options
author | Jeff Tinker <jtinker@google.com> | 2013-08-16 13:46:02 -0700 |
---|---|---|
committer | Jeff Tinker <jtinker@google.com> | 2013-08-16 13:46:02 -0700 |
commit | 8117d8f7023f8981bc4b2651efed5b28104d83d3 (patch) | |
tree | 7b34924a365c524db23a9d2307f0acdee9eaddea /media/jni | |
parent | 0d8afa2ea314c142320bf921f81540a37561f6eb (diff) | |
download | frameworks_base-8117d8f7023f8981bc4b2651efed5b28104d83d3.zip frameworks_base-8117d8f7023f8981bc4b2651efed5b28104d83d3.tar.gz frameworks_base-8117d8f7023f8981bc4b2651efed5b28104d83d3.tar.bz2 |
Fix JNI method called with exception pending
bug: 10313912
Change-Id: I8390905334f2e37f210adced52c31e7a431d4f55
Diffstat (limited to 'media/jni')
-rw-r--r-- | media/jni/android_media_MediaDrm.cpp | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/media/jni/android_media_MediaDrm.cpp b/media/jni/android_media_MediaDrm.cpp index 16a1e48..60142cd 100644 --- a/media/jni/android_media_MediaDrm.cpp +++ b/media/jni/android_media_MediaDrm.cpp @@ -753,7 +753,9 @@ static jbyteArray android_media_MediaDrm_provideKeyResponse( status_t err = drm->provideKeyResponse(sessionId, response, keySetId); - throwExceptionAsNecessary(env, err, "Failed to handle key response"); + if (throwExceptionAsNecessary(env, err, "Failed to handle key response")) { + return NULL; + } return VectorToJByteArray(env, keySetId); } @@ -1104,7 +1106,9 @@ static jbyteArray android_media_MediaDrm_encryptNative( status_t err = drm->encrypt(sessionId, keyId, input, iv, output); - throwExceptionAsNecessary(env, err, "Failed to encrypt"); + if (throwExceptionAsNecessary(env, err, "Failed to encrypt")) { + return NULL; + } return VectorToJByteArray(env, output); } @@ -1132,7 +1136,9 @@ static jbyteArray android_media_MediaDrm_decryptNative( Vector<uint8_t> output; status_t err = drm->decrypt(sessionId, keyId, input, iv, output); - throwExceptionAsNecessary(env, err, "Failed to decrypt"); + if (throwExceptionAsNecessary(env, err, "Failed to decrypt")) { + return NULL; + } return VectorToJByteArray(env, output); } @@ -1160,7 +1166,9 @@ static jbyteArray android_media_MediaDrm_signNative( status_t err = drm->sign(sessionId, keyId, message, signature); - throwExceptionAsNecessary(env, err, "Failed to sign"); + if (throwExceptionAsNecessary(env, err, "Failed to sign")) { + return NULL; + } return VectorToJByteArray(env, signature); } |