Add MediaDrm property to allow test keybox am: df04f3f0f8

Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/16507299

Change-Id: I734f26fa06a19ac6e8526bfdaa074fb5a8bbdab3
This commit is contained in:
Fred Gylys-Colwell
2022-01-07 05:57:13 +00:00
committed by Automerger Merge Worker
4 changed files with 35 additions and 0 deletions

View File

@@ -159,8 +159,14 @@ class WvContentDecryptionModule : public android::RefBase, public TimerHandler {
// Closes the CdmEngine and sessions associated with the given CdmIdentifier.
virtual CdmResponseType CloseCdm(const CdmIdentifier& identifier);
// When positive, the keybox will be ignored at initialization and force the
// device to request a keybox OTA reprovisioning.
virtual CdmResponseType SetDebugIgnoreKeyboxCount(uint32_t count);
// Allow the device to continue with a test keybox. Otherwise, it will fall
// back to L3.
virtual CdmResponseType SetAllowTestKeybox(bool allow);
virtual CdmResponseType SetDecryptHash(const std::string& hash_data,
CdmSessionId* session_id);
virtual CdmResponseType GetDecryptHashError(const CdmSessionId& session_id,

View File

@@ -505,6 +505,11 @@ CdmResponseType WvContentDecryptionModule::SetDebugIgnoreKeyboxCount(
return CdmEngine::SetDebugIgnoreKeyboxCount(count);
}
CdmResponseType WvContentDecryptionModule::SetAllowTestKeybox(bool allow) {
// TODO(210807585) add functionality in next CL.
return NO_ERROR;
}
CdmResponseType WvContentDecryptionModule::SetDecryptHash(
const std::string& hash_data, CdmSessionId* id) {
if (id == nullptr) {

View File

@@ -679,6 +679,18 @@ status_t WVDrmPlugin::setPropertyString(const String8& name,
}
CdmResponseType res = mCDM->SetDebugIgnoreKeyboxCount(count);
return mapCdmResponseType(res);
} else if (name == "allowTestKeybox") {
bool allow;
if (value == kEnable) {
allow = true;
} else if (value == kDisable) {
allow = false;
} else {
ALOGE("App requested unknown allowTestKeybox %s", value.string());
return android::BAD_VALUE;
}
CdmResponseType res = mCDM->SetAllowTestKeybox(allow);
return mapCdmResponseType(res);
} else if (name == "decryptHash") {
CdmSessionId sessionId;
CdmResponseType res =

View File

@@ -1443,6 +1443,18 @@ Return<Status> WVDrmPlugin::setPropertyString(const hidl_string& propertyName,
}
CdmResponseType res = mCDM->SetDebugIgnoreKeyboxCount(count);
return mapCdmResponseType(res);
} else if (name == "allowTestKeybox") {
bool allow;
if (_value == kEnable) {
allow = true;
} else if (_value == kDisable) {
allow = false;
} else {
ALOGE("App requested unknown allowTestKeybox %s", _value.c_str());
return Status::BAD_VALUE;
}
CdmResponseType res = mCDM->SetAllowTestKeybox(allow);
return mapCdmResponseType(res);
} else if (name == "decryptHash") {
wvcdm::CdmSessionId sessionId;
CdmResponseType res =