diff options
author | Jeff Tinker <jtinker@google.com> | 2015-06-03 20:03:28 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2015-06-03 20:03:29 +0000 |
commit | 4575acf1e72827dd6fd6cb645abfb3ba9043fa47 (patch) | |
tree | 4986a4752868359ce18381ebaf51874d69a831bb /media/jni | |
parent | c52e0d900cc6f7ca60c7079ab50297b4a4b0c426 (diff) | |
parent | 025af8b0de1c4697a54f6b7363e27111a00eb284 (diff) | |
download | frameworks_base-4575acf1e72827dd6fd6cb645abfb3ba9043fa47.zip frameworks_base-4575acf1e72827dd6fd6cb645abfb3ba9043fa47.tar.gz frameworks_base-4575acf1e72827dd6fd6cb645abfb3ba9043fa47.tar.bz2 |
Merge "Fix bug in MediaCrypto.setMediaDrmSession" into mnc-dev
Diffstat (limited to 'media/jni')
-rw-r--r-- | media/jni/android_media_MediaCrypto.cpp | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/media/jni/android_media_MediaCrypto.cpp b/media/jni/android_media_MediaCrypto.cpp index a9accb0..d7968d2 100644 --- a/media/jni/android_media_MediaCrypto.cpp +++ b/media/jni/android_media_MediaCrypto.cpp @@ -301,17 +301,19 @@ static void android_media_MediaCrypto_setMediaDrmSession( status_t err = crypto->setMediaDrmSession(sessionId); - String8 msg("setMediaDrmSession failed"); - if (err == ERROR_DRM_SESSION_NOT_OPENED) { - msg += ": session not opened"; - } else if (err == ERROR_UNSUPPORTED) { - msg += ": not supported by this crypto scheme"; - } else if (err == NO_INIT) { - msg += ": crypto plugin not initialized"; - } else if (err != OK) { - msg.appendFormat(": general failure (%d)", err); + if (err != OK) { + String8 msg("setMediaDrmSession failed"); + if (err == ERROR_DRM_SESSION_NOT_OPENED) { + msg += ": session not opened"; + } else if (err == ERROR_UNSUPPORTED) { + msg += ": not supported by this crypto scheme"; + } else if (err == NO_INIT) { + msg += ": crypto plugin not initialized"; + } else { + msg.appendFormat(": general failure (%d)", err); + } + jniThrowException(env, "android/media/MediaCryptoException", msg.string()); } - jniThrowException(env, "android/media/MediaCryptoException", msg.string()); } static JNINativeMethod gMethods[] = { |