Added CDM support for production readiness reporting. am: cd5afa88a6 am: cce550d006

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

Change-Id: Ib68038545cfc302f34eabe52264188b3e7ff356b
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Alex Dale
2022-05-10 22:04:13 +00:00
committed by Automerger Merge Worker
13 changed files with 112 additions and 10 deletions

View File

@@ -2350,6 +2350,34 @@ bool CryptoSession::GetWatermarkingSupport(
return true;
}
bool CryptoSession::GetProductionReadiness(CdmProductionReadiness* readiness) {
RETURN_IF_NOT_OPEN(false);
return GetProductionReadiness(requested_security_level_, readiness);
}
bool CryptoSession::GetProductionReadiness(
RequestedSecurityLevel security_level, CdmProductionReadiness* readiness) {
LOGV("security_level = %s", RequestedSecurityLevelToString(security_level));
RETURN_IF_UNINITIALIZED(false);
RETURN_IF_NULL(readiness, false);
const OEMCryptoResult result = WithOecReadLock("GetProductionReadiness", [&] {
return OEMCrypto_ProductionReady(security_level);
});
switch (result) {
case OEMCrypto_SUCCESS:
*readiness = kProductionReadinessTrue;
break;
case OEMCrypto_ERROR_NOT_IMPLEMENTED:
*readiness = kProductionReadinessUnknown;
break;
case OEMCrypto_ERROR_UNKNOWN_FAILURE:
default: // Other vendor-defined codes indicate not production ready.
*readiness = kProductionReadinessFalse;
break;
}
return true;
}
bool CryptoSession::GetMaximumUsageTableEntries(
RequestedSecurityLevel security_level, size_t* number_of_entries) {
LOGV("Getting maximum usage table entries: security_level = %s",