Add usage support query method

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

A helper method has been added to CryptoSession to determine whether the
TEE supports usage tables, usage table headers+entries or does not
provide any support for persistent licenses.

In addition
* CryptoSession now supports deletion of multiple
  usage entries rather than a single one.
* Typedefs have been added for usage table headers and entries

b/34327459

Test: Verified by unit/integration tests on angler.

Change-Id: I634d3b7b81ce94d1deccd2a7aaf26b9efde414a8
This commit is contained in:
Rahul Frias
2017-02-06 17:49:37 -08:00
parent 6d617e2be4
commit db6df99db1
8 changed files with 125 additions and 43 deletions

View File

@@ -69,7 +69,7 @@ class DeviceFiles {
int64_t last_playback_time,
int64_t grace_period_end_time,
const CdmAppParameterMap& app_parameters,
const std::string& usage_entry);
const CdmUsageEntry& usage_entry);
virtual bool RetrieveLicense(
const std::string& key_set_id, LicenseState* state,
CdmInitData* pssh_data, CdmKeyMessage* key_request,
@@ -77,7 +77,7 @@ class DeviceFiles {
CdmKeyResponse* key_renewal_response, std::string* release_server_url,
int64_t* playback_start_time, int64_t* last_playback_time,
int64_t* grace_period_end_time, CdmAppParameterMap* app_parameters,
std::string* usage_entry);
CdmUsageEntry* usage_entry);
virtual bool DeleteLicense(const std::string& key_set_id);
virtual bool ListLicenses(std::vector<std::string>* key_set_ids);
virtual bool DeleteAllFiles();
@@ -91,7 +91,7 @@ class DeviceFiles {
const CdmKeyResponse& key_response,
const std::string& app_id,
const std::string& key_set_id,
const std::string& usage_entry);
const CdmUsageEntry& usage_entry);
virtual bool DeleteUsageInfo(const std::string& app_id,
const std::string& provider_session_token);
// Delete usage information from the file system. Puts a list of all the
@@ -110,14 +110,14 @@ class DeviceFiles {
const std::string& provider_session_token,
CdmKeyMessage* license_request,
CdmKeyResponse* license_response,
std::string* usage_entry);
CdmUsageEntry* usage_entry);
// Retrieve the usage info entry specified by |key_set_id|.
// Returns false if the entry could not be found.
virtual bool RetrieveUsageInfoByKeySetId(const std::string& app_id,
const std::string& key_set_id,
CdmKeyMessage* license_request,
CdmKeyResponse* license_response,
std::string* usage_entry);
CdmUsageEntry* usage_entry);
virtual bool StoreHlsAttributes(const std::string& key_set_id,
const CdmHlsMethod method,
@@ -128,11 +128,11 @@ class DeviceFiles {
virtual bool DeleteHlsAttributes(const std::string& key_set_id);
virtual bool StoreUsageTableInfo(
const std::string& usage_table_header,
const CdmUsageTableHeader& usage_table_header,
const std::vector<UsageEntryInfo>& usage_entry_info);
virtual bool RetrieveUsageTableInfo(
std::string* usage_table_header,
CdmUsageTableHeader* usage_table_header,
std::vector<UsageEntryInfo>* usage_entry_info);
private: