Clarify decrypt error detail messages
Merge of http://go/wvgerrit/14290 from widevine cdm repo. Change-Id: I4c33a1202ca45064c65c7c1a4e36fed999f7bd82 related-to-bug: 20857014
This commit is contained in:
@@ -177,9 +177,12 @@ ssize_t WVCryptoPlugin::decrypt(bool secure, const uint8_t key[KEY_ID_SIZE],
|
||||
if (!isCdmResponseTypeSuccess(res)) {
|
||||
ALOGE("Decrypt error result in session %s during unencrypted block: %d",
|
||||
mSessionId.c_str(), res);
|
||||
errorDetailMsg->setTo("Error decrypting data.");
|
||||
if (res == wvcdm::INSUFFICIENT_CRYPTO_RESOURCES ||
|
||||
res == wvcdm::NEED_KEY) {
|
||||
if (res == wvcdm::INSUFFICIENT_CRYPTO_RESOURCES) {
|
||||
errorDetailMsg->setTo("Error decrypting data: insufficient crypto resources");
|
||||
// This error is actionable by the app and should be passed up.
|
||||
return mapCdmResponseType(res);
|
||||
} else if (res == wvcdm::NEED_KEY) {
|
||||
errorDetailMsg->setTo("Error decrypting data: requested key has not been loaded");
|
||||
// This error is actionable by the app and should be passed up.
|
||||
return mapCdmResponseType(res);
|
||||
} else {
|
||||
@@ -207,9 +210,12 @@ ssize_t WVCryptoPlugin::decrypt(bool secure, const uint8_t key[KEY_ID_SIZE],
|
||||
if (!isCdmResponseTypeSuccess(res)) {
|
||||
ALOGE("Decrypt error result in session %s during encrypted block: %d",
|
||||
mSessionId.c_str(), res);
|
||||
errorDetailMsg->setTo("Error decrypting data.");
|
||||
if (res == wvcdm::INSUFFICIENT_CRYPTO_RESOURCES ||
|
||||
res == wvcdm::NEED_KEY) {
|
||||
if (res == wvcdm::INSUFFICIENT_CRYPTO_RESOURCES) {
|
||||
errorDetailMsg->setTo("Error decrypting data: insufficient crypto resources");
|
||||
// This error is actionable by the app and should be passed up.
|
||||
return mapCdmResponseType(res);
|
||||
} else if (res == wvcdm::NEED_KEY) {
|
||||
errorDetailMsg->setTo("Error decrypting data: requested key has not been loaded");
|
||||
// This error is actionable by the app and should be passed up.
|
||||
return mapCdmResponseType(res);
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user