aidl plugin: add error details to return status

Merged from http://go/wvgerrit/163639

Bug: 253271674
Test: Google TV
Test: atest MediaDrmParameterizedTests
Test: atest DrmSessionManagerTest
Change-Id: I9f0e83774d405466a389d2fd90d693830682dde4
This commit is contained in:
Robert Shih
2022-11-30 18:39:52 -08:00
committed by Edwin Wong
parent 2384efde1e
commit 1fdbd3cd2c
15 changed files with 354 additions and 311 deletions

View File

@@ -278,7 +278,7 @@ SharedBufferBase::~SharedBufferBase() {
// Decrypt
std::string errorDetailMsg;
Status res = attemptDecrypt(params, hasProtectedData, &errorDetailMsg);
auto res = attemptDecrypt(params, hasProtectedData, &errorDetailMsg);
native_handle_delete(handle);
if (res != Status::OK) {
detailedError = errorDetailMsg.data();
@@ -296,13 +296,13 @@ SharedBufferBase::~SharedBufferBase() {
return binder;
}
Status WVCryptoPlugin::attemptDecrypt(const CdmDecryptionParametersV16& params,
bool hasProtectedData,
std::string* errorDetailMsg) {
::wvdrm::WvStatus WVCryptoPlugin::attemptDecrypt(
const CdmDecryptionParametersV16& params, bool hasProtectedData,
std::string* errorDetailMsg) {
CdmResponseType res = mCDM->DecryptV16(mSessionId, hasProtectedData, params);
if (::wvdrm::isCdmResponseTypeSuccess(res)) {
return Status::OK;
return ::wvdrm::WvStatus(Status::OK);
} else {
ALOGE("Decrypt error in session %s during a sample %s protected data: %d",
mSessionId.c_str(), hasProtectedData ? "with" : "without", static_cast<int>(res));
@@ -340,7 +340,7 @@ Status WVCryptoPlugin::attemptDecrypt(const CdmDecryptionParametersV16& params,
break;
}
return ::wvdrm::mapCdmResponseType<Status>(res);
return ::wvdrm::mapCdmResponseType(res);
}
}