Merge "Android CDM: Restored secure stop tests." into udc-dev
This commit is contained in:
@@ -261,18 +261,28 @@ bool WvContentDecryptionModule::IsProvisioned(CdmSecurityLevel security_level,
|
||||
|
||||
CdmResponseType WvContentDecryptionModule::GetUsageInfo(
|
||||
const std::string& app_id, const CdmIdentifier& identifier,
|
||||
CdmUsageInfo* usage_info) {
|
||||
CdmUsageReportList* usage_reports) {
|
||||
if (usage_reports == nullptr) return CdmResponseType(PARAMETER_NULL);
|
||||
CdmEngine* cdm_engine = EnsureCdmForIdentifier(identifier);
|
||||
int error_detail = NO_ERROR;
|
||||
return cdm_engine->GetUsageInfo(app_id, &error_detail, usage_info);
|
||||
CdmUsageReport usage_report;
|
||||
// Doesn't actually retrieve all reports, just a single random one.
|
||||
const CdmResponseType status =
|
||||
cdm_engine->GetUsageInfo(app_id, &error_detail, &usage_report);
|
||||
usage_reports->clear();
|
||||
// Possible that no report is available, still a successful call.
|
||||
if ((status == NO_ERROR || status == KEY_MESSAGE) && !usage_report.empty()) {
|
||||
usage_reports->push_back(std::move(usage_report));
|
||||
}
|
||||
return status;
|
||||
}
|
||||
|
||||
CdmResponseType WvContentDecryptionModule::GetUsageInfo(
|
||||
const std::string& app_id, const CdmSecureStopId& ssid,
|
||||
const CdmIdentifier& identifier, CdmUsageInfo* usage_info) {
|
||||
const CdmIdentifier& identifier, CdmUsageReport* usage_report) {
|
||||
CdmEngine* cdm_engine = EnsureCdmForIdentifier(identifier);
|
||||
int error_detail = NO_ERROR;
|
||||
return cdm_engine->GetUsageInfo(app_id, ssid, &error_detail, usage_info);
|
||||
return cdm_engine->GetUsageInfo(app_id, ssid, &error_detail, usage_report);
|
||||
}
|
||||
|
||||
CdmResponseType WvContentDecryptionModule::RemoveAllUsageInfo(
|
||||
@@ -289,8 +299,7 @@ CdmResponseType WvContentDecryptionModule::RemoveUsageInfo(
|
||||
}
|
||||
|
||||
CdmResponseType WvContentDecryptionModule::ReleaseUsageInfo(
|
||||
const CdmUsageInfoReleaseMessage& message,
|
||||
const CdmIdentifier& identifier) {
|
||||
const CdmKeyResponse& message, const CdmIdentifier& identifier) {
|
||||
CdmEngine* cdm_engine = EnsureCdmForIdentifier(identifier);
|
||||
return cdm_engine->ReleaseUsageInfo(message);
|
||||
}
|
||||
@@ -306,10 +315,10 @@ CdmResponseType WvContentDecryptionModule::GetSecureStopIds(
|
||||
CdmEngine* cdm_engine = EnsureCdmForIdentifier(identifier);
|
||||
const CdmResponseType sts =
|
||||
cdm_engine->ListUsageIds(app_id, kSecurityLevelL1, nullptr, ssids);
|
||||
std::vector<CdmSecureStopId> secure_stop_ids;
|
||||
const CdmResponseType sts_l3 = cdm_engine->ListUsageIds(
|
||||
app_id, kSecurityLevelL3, nullptr, &secure_stop_ids);
|
||||
ssids->insert(ssids->end(), secure_stop_ids.begin(), secure_stop_ids.end());
|
||||
std::vector<CdmSecureStopId> ssids_l3;
|
||||
const CdmResponseType sts_l3 =
|
||||
cdm_engine->ListUsageIds(app_id, kSecurityLevelL3, nullptr, &ssids_l3);
|
||||
ssids->insert(ssids->end(), ssids_l3.begin(), ssids_l3.end());
|
||||
return sts_l3 != NO_ERROR ? sts_l3 : sts;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user