wv hidl: map CdmResponseType to drm@1.4 Status

Bug: 162255728
Test: VtsHalDrmV1_4TargetTest
Change-Id: Icc96c17f38218475efc7489348b75c9978f16b01
This commit is contained in:
Robert Shih
2021-02-08 19:08:14 -08:00
parent e77b029214
commit 6ed2c30a0a
3 changed files with 316 additions and 15 deletions

View File

@@ -302,7 +302,6 @@ Status_V1_2 WVCryptoPlugin::attemptDecrypt(
mSessionId.c_str(),
hasProtectedData ? "with" : "without",
res);
bool actionableError = true;
switch (res) {
case wvcdm::INSUFFICIENT_CRYPTO_RESOURCES:
errorDetailMsg->assign(
@@ -335,17 +334,10 @@ Status_V1_2 WVCryptoPlugin::attemptDecrypt(
"Error decrypting data: key prohibited for security level");
break;
default:
actionableError = false;
break;
}
if (actionableError) {
// This error is actionable by the app and should be passed up.
return mapCdmResponseType_1_2(res);
} else {
// Swallow the specifics of other errors to obscure decrypt internals.
return Status_V1_2::ERROR_DRM_UNKNOWN;
}
return mapCdmResponseType<Status_V1_2>(res);
}
}