Allow queries without opening a session

[ Merge of http://go/wvgerrit/69724 ]

Some queries no longer require a session to be opened before they
can be answered - security level, current HDCP level, max HDCP level,
usage support, number of open sessions, max sessions,
OEMCrypto API version, current SRM version, SRM update support,
resource rating tier and OEMCrypto build information.

b/117104043
Test: WV unit/integration tests

Change-Id: I92f8249e5599860da8cbf42d3b16f25515a46c55
This commit is contained in:
Rahul Frias
2019-01-08 09:52:40 -08:00
parent 38c45a66a3
commit 22e991343b
5 changed files with 253 additions and 142 deletions

View File

@@ -66,10 +66,16 @@ class CryptoSession {
virtual CdmClientTokenType GetPreProvisionTokenType() {
return pre_provision_token_type_;
}
// The overloaded methods with |requested_level| may be called
// without a preceding call to Open. The other method must call Open first.
virtual CdmSecurityLevel GetSecurityLevel();
virtual CdmSecurityLevel GetSecurityLevel(SecurityLevel requested_level);
virtual bool GetApiVersion(uint32_t* version);
virtual bool GetApiVersion(SecurityLevel requested_level, uint32_t* version);
virtual bool GetInternalDeviceUniqueId(std::string* device_id);
virtual bool GetExternalDeviceUniqueId(std::string* device_id);
virtual bool GetApiVersion(uint32_t* version);
virtual bool GetSystemId(uint32_t* system_id);
virtual bool GetProvisioningId(std::string* provisioning_id);
virtual uint8_t GetSecurityPatchLevel();
@@ -116,7 +122,11 @@ class CryptoSession {
virtual CdmResponseType Decrypt(const CdmDecryptionParameters& params);
// Usage related methods
// The overloaded method with |security_level| may be called without a
// preceding call to Open. The other method must call Open first.
virtual bool UsageInformationSupport(bool* has_support);
virtual bool UsageInformationSupport(SecurityLevel security_level,
bool* has_support);
virtual CdmResponseType UpdateUsageInformation(); // only for OEMCrypto v9-12
virtual CdmResponseType DeactivateUsageInformation(
const std::string& provider_session_token);
@@ -138,21 +148,32 @@ class CryptoSession {
virtual CdmResponseType DeleteAllUsageReports();
virtual bool IsAntiRollbackHwPresent();
// The overloaded methods with |security_level| may be called without a
// preceding call to Open. The other methods must call Open first.
virtual bool GetHdcpCapabilities(HdcpCapability* current,
HdcpCapability* max);
virtual bool GetHdcpCapabilities(SecurityLevel security_level,
HdcpCapability* current,
HdcpCapability* max);
virtual bool GetResourceRatingTier(uint32_t* tier);
virtual bool GetResourceRatingTier(SecurityLevel security_level,
uint32_t* tier);
virtual bool GetSupportedCertificateTypes(SupportedCertificateTypes* support);
virtual bool GetRandom(size_t data_length, uint8_t* random_data);
virtual bool GetNumberOfOpenSessions(size_t* count);
virtual bool GetMaxNumberOfSessions(size_t* max);
virtual bool GetNumberOfOpenSessions(SecurityLevel security_level,
size_t* count);
virtual bool GetMaxNumberOfSessions(SecurityLevel security_level,
size_t* max);
virtual bool GetSrmVersion(uint16_t* srm_version);
virtual bool IsSrmUpdateSupported();
virtual bool LoadSrm(const std::string& srm);
virtual bool GetResourceRatingTier(uint32_t* tier);
virtual bool GetBuildInformation(std::string* info);
virtual bool GetBuildInformation(SecurityLevel security_level,
std::string* info);
virtual uint32_t IsDecryptHashSupported();
virtual uint32_t IsDecryptHashSupported(SecurityLevel security_level);
virtual CdmResponseType SetDecryptHash(uint32_t frame_number,
const std::string& hash);