Add new CDM API call: Cdm::removeUsageTable()
[ Merge of http://go/wvgerrit/23168 ] Bug: 33380441 Test: WV unit/integration tests Change-Id: Id63c31cdb367704b0bbb77ea9ea597cc86259eeb
This commit is contained in:
@@ -172,6 +172,9 @@ class CdmEngine {
|
||||
virtual CdmResponseType ListStoredLicenses(
|
||||
CdmSecurityLevel security_level, std::vector<std::string>* key_set_ids);
|
||||
|
||||
// Delete OEMCrypto usage tables. Used by Unprovision().
|
||||
CdmResponseType DeleteUsageTable(CdmSecurityLevel security_level);
|
||||
|
||||
// Usage related methods for streaming licenses
|
||||
// Retrieve a random usage info from the list of all usage infos for this app
|
||||
// id.
|
||||
|
||||
@@ -902,32 +902,28 @@ CdmResponseType CdmEngine::Unprovision(CdmSecurityLevel security_level) {
|
||||
LOGE("CdmEngine::Unprovision: unable to delete files");
|
||||
return UNPROVISION_ERROR_3;
|
||||
}
|
||||
|
||||
CryptoSession crypto_session(metrics_.GetCryptoMetrics());
|
||||
CdmResponseType status;
|
||||
M_TIME(
|
||||
status = crypto_session.Open(
|
||||
security_level == kSecurityLevelL3 ?
|
||||
kLevel3 :
|
||||
kLevelDefault),
|
||||
metrics_.GetCryptoMetrics(),
|
||||
crypto_session_open_,
|
||||
status,
|
||||
security_level == kSecurityLevelL3 ? kLevel3 : kLevelDefault);
|
||||
if (NO_ERROR != status) {
|
||||
LOGE("CdmEngine::Unprovision: error opening crypto session: %d", status);
|
||||
return UNPROVISION_ERROR_4;
|
||||
}
|
||||
status = crypto_session.DeleteAllUsageReports();
|
||||
metrics_.GetCryptoMetrics()->crypto_session_delete_all_usage_reports_.
|
||||
Increment(status);
|
||||
if (status != NO_ERROR) {
|
||||
LOGE("CdmEngine::Unprovision: error deleteing usage reports: %d", status);
|
||||
}
|
||||
return status;
|
||||
return DeleteUsageTable(security_level);
|
||||
}
|
||||
}
|
||||
|
||||
CdmResponseType CdmEngine::DeleteUsageTable(CdmSecurityLevel security_level) {
|
||||
scoped_ptr<CryptoSession> crypto_session(
|
||||
new CryptoSession(metrics_.GetCryptoMetrics()));
|
||||
CdmResponseType status = crypto_session->Open(
|
||||
security_level == kSecurityLevelL3 ? kLevel3 : kLevelDefault);
|
||||
if (NO_ERROR != status) {
|
||||
LOGE("CdmEngine::DeleteUsageTable: error opening crypto session: %d",
|
||||
status);
|
||||
return UNPROVISION_ERROR_4;
|
||||
}
|
||||
status = crypto_session->DeleteAllUsageReports();
|
||||
if (status != NO_ERROR) {
|
||||
LOGE("CdmEngine::DeleteUsageTable: error deleting usage reports: %d",
|
||||
status);
|
||||
}
|
||||
return status;
|
||||
}
|
||||
|
||||
CdmResponseType CdmEngine::ListStoredLicenses(
|
||||
CdmSecurityLevel security_level, std::vector<std::string>* key_set_ids) {
|
||||
DeviceFiles handle(file_system_);
|
||||
|
||||
Reference in New Issue
Block a user