Squashed merge 3 CLs.

1. "Change CdmResponseType from enum into a struct"
Merged from http://go/wvgerrit/163199
Bug: 253271674

2. "Log request information when server returns 401"
Bug: 260760387
Bug: 186031735
Merged from http://go/wvgerrit/162798

3. "Specify server version on the command line"
Bug: 251599048
Merged from http://go/wvgerrit/158897

Test: build android.hardware.drm-service.widevine
Test: Netflix and Play Movies & TV
Test: build_and_run_all_unit_tests.sh

Bug: 253271674
Change-Id: I70c950acce070609ee0343920ec68e66b058bc23
This commit is contained in:
Robert Shih
2022-11-16 10:02:18 -08:00
committed by Edwin Wong
parent ac9641ae13
commit 096b0eda5a
46 changed files with 1726 additions and 1443 deletions

View File

@@ -446,7 +446,7 @@ SecurityLevel WVDrmPlugin::mapSecurityLevel(const std::string& level) {
if (in_keyType == KeyType::RELEASE) {
// When releasing keys, we do not have a session ID.
status = mapCdmResponseType<Status>(res);
status = mapCdmResponseType(res);
} else {
// For all other requests, we have a session ID.
status = mapAndNotifyOfCdmResponseType(in_scope, res);
@@ -949,7 +949,8 @@ Status WVDrmPlugin::unprovisionDevice() {
std::string level = info[wvcdm::QUERY_KEY_SECURITY_LEVEL];
securityLevel = mapSecurityLevel(level);
} else {
ALOGE("Failed to query security level, status=%d", status);
ALOGE("Failed to query security level, status=%d",
static_cast<int>(status));
}
*_aidl_return = securityLevel;
@@ -971,7 +972,7 @@ Status WVDrmPlugin::unprovisionDevice() {
vector<CdmSecurityLevel> levels = {wvcdm::kSecurityLevelL1,
wvcdm::kSecurityLevelL3};
CdmResponseType res = wvcdm::UNKNOWN_ERROR;
CdmResponseType res(wvcdm::UNKNOWN_ERROR);
for (auto level : levels) {
vector<CdmKeySetId> cdmKeySetIds;
@@ -1010,7 +1011,7 @@ Status WVDrmPlugin::unprovisionDevice() {
return toNdkScopedAStatus(status);
}
CdmResponseType res = wvcdm::UNKNOWN_ERROR;
CdmResponseType res = wvcdm::CdmResponseType(wvcdm::UNKNOWN_ERROR);
CdmKeySetId keySetIdStr(in_keySetId.keySetId.begin(),
in_keySetId.keySetId.end());
@@ -1056,7 +1057,7 @@ Status WVDrmPlugin::unprovisionDevice() {
return toNdkScopedAStatus(status);
}
CdmResponseType res = wvcdm::UNKNOWN_ERROR;
CdmResponseType res(wvcdm::UNKNOWN_ERROR);
res = mCDM->RemoveOfflineLicense(
std::string(in_keySetId.keySetId.begin(), in_keySetId.keySetId.end()),
@@ -1313,6 +1314,7 @@ Status WVDrmPlugin::unprovisionDevice() {
CdmResponseType res = mCDM->SetDecryptHash(_value.c_str(), &sessionId);
if (wvcdm::NO_ERROR == res) mDecryptHashSessionId = sessionId;
return toNdkScopedAStatus(mapCdmResponseType(res));
} else if (name == "decryptHashSessionId") {
mDecryptHashSessionId = _value.c_str();
@@ -1846,7 +1848,7 @@ Status WVDrmPlugin::queryProperty(RequestedSecurityLevel securityLevel,
mCDM->QueryStatus(securityLevel, property, &stringValue);
if (res != wvcdm::NO_ERROR) {
ALOGE("Error querying CDM status: %u", res);
ALOGE("Error querying CDM status: %d", static_cast<int>(res));
}
return mapCdmResponseType(res);
}