Added CDM support for production readiness reporting.
[ Merge of http://go/wvgerrit/151518 ] Extended the CDM layer to report OEMCrypto's production readiness via string property query. If OEMCrypto implementents OEMCrypto_ProductionReady(), then the reported readiness by the CDM will report "True" or "False". If OEMCrypto does not implement OEMCrypto_ProductionReady() then no level of readiness is assumed, and the CDM will report "Unknown". Bug: 231655151 Test: run_prov30_tests and request_license_test Change-Id: I6afe481ef00ac129d02b004eca89a65810bfbff8
This commit is contained in:
@@ -2345,6 +2345,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",
|
||||
|
||||
Reference in New Issue
Block a user