Merge "MediaCryptoException: human readable error codes" into sc-dev am: f5e313dc1f
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/13639134 MUST ONLY BE SUBMITTED BY AUTOMERGER Change-Id: I5a34cb77085d1135cefeb29c81eb83cde0e52985
This commit is contained in:
@@ -202,10 +202,11 @@ static void android_media_MediaCrypto_native_setup(
|
|||||||
uuid = NULL;
|
uuid = NULL;
|
||||||
|
|
||||||
if (err != OK) {
|
if (err != OK) {
|
||||||
jniThrowException(
|
std::string strerr(StrCryptoError(err));
|
||||||
|
jniThrowExceptionFmt(
|
||||||
env,
|
env,
|
||||||
"android/media/MediaCryptoException",
|
"android/media/MediaCryptoException",
|
||||||
"Failed to instantiate crypto object.");
|
"Failed to instantiate crypto object: %s", strerr.c_str());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -295,7 +296,8 @@ static void android_media_MediaCrypto_setMediaDrmSession(
|
|||||||
} else if (err == NO_INIT) {
|
} else if (err == NO_INIT) {
|
||||||
msg += ": crypto plugin not initialized";
|
msg += ": crypto plugin not initialized";
|
||||||
} else {
|
} else {
|
||||||
msg.appendFormat(": general failure (%d)", err);
|
std::string strerr(StrCryptoError(err));
|
||||||
|
msg.appendFormat(": general failure (%s)", strerr.c_str());
|
||||||
}
|
}
|
||||||
jniThrowException(env, "android/media/MediaCryptoException", msg.string());
|
jniThrowException(env, "android/media/MediaCryptoException", msg.string());
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user