diff --git a/libwvdrmengine/mediacrypto/src/WVCryptoPlugin.cpp b/libwvdrmengine/mediacrypto/src/WVCryptoPlugin.cpp index 55e0dffc..df3bc3e8 100644 --- a/libwvdrmengine/mediacrypto/src/WVCryptoPlugin.cpp +++ b/libwvdrmengine/mediacrypto/src/WVCryptoPlugin.cpp @@ -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 {