Merge "Check L3 for secure stops" into tm-dev am: f4e2e9833d
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/18192750 Change-Id: I5054995864e65066f8b786d8ce1fc544147de1c3 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
@@ -243,15 +243,24 @@ class CdmEngine {
|
||||
int* error_detail,
|
||||
CdmUsageInfo* usage_info);
|
||||
|
||||
// Retrieve the usage info for the specified pst.
|
||||
// Returns UNKNOWN_ERROR if no usage info was found.
|
||||
// id. If |error_detail| is not null, an additional error code may be provided
|
||||
// Retrieve usage info whose PST is specified by |ssid|
|
||||
// If |error_detail| is not null, an additional error code may be provided
|
||||
// in the event of an error.
|
||||
virtual CdmResponseType GetUsageInfo(const std::string& app_id,
|
||||
const CdmSecureStopId& ssid,
|
||||
int* error_detail,
|
||||
CdmUsageInfo* usage_info);
|
||||
|
||||
// Retrieve usage info for a given security level and whose
|
||||
// PST is specified by |ssid|.
|
||||
// If |error_detail| is not null, an additional error code may be provided
|
||||
// in the event of an error.
|
||||
virtual CdmResponseType GetUsageInfo(const std::string& app_id,
|
||||
const CdmSecureStopId& ssid,
|
||||
RequestedSecurityLevel security_level,
|
||||
int* error_detail,
|
||||
CdmUsageInfo* usage_info);
|
||||
|
||||
// Remove all usage records for the current origin.
|
||||
virtual CdmResponseType RemoveAllUsageInfo(const std::string& app_id,
|
||||
CdmSecurityLevel security_level);
|
||||
|
||||
@@ -1385,6 +1385,28 @@ CdmResponseType CdmEngine::GetUsageInfo(const std::string& app_id,
|
||||
const CdmSecureStopId& ssid,
|
||||
int* error_detail,
|
||||
CdmUsageInfo* usage_info) {
|
||||
// Try to find usage info at the default security level. If the
|
||||
// security level is unprovisioned or we are unable to find it,
|
||||
// try L3.
|
||||
CdmResponseType status =
|
||||
GetUsageInfo(app_id, ssid, kLevelDefault, error_detail, usage_info);
|
||||
switch (status) {
|
||||
case NEED_PROVISIONING:
|
||||
case GET_USAGE_INFO_ERROR_1:
|
||||
case GET_USAGE_INFO_ERROR_2:
|
||||
case USAGE_INFO_NOT_FOUND:
|
||||
status = GetUsageInfo(app_id, ssid, kLevel3, error_detail, usage_info);
|
||||
return status;
|
||||
default:
|
||||
return status;
|
||||
}
|
||||
}
|
||||
|
||||
CdmResponseType CdmEngine::GetUsageInfo(const std::string& app_id,
|
||||
const CdmSecureStopId& ssid,
|
||||
RequestedSecurityLevel security_level,
|
||||
int* error_detail,
|
||||
CdmUsageInfo* usage_info) {
|
||||
LOGI("app_id = %s, ssid = %s", IdToString(app_id), IdToString(ssid));
|
||||
if (!usage_property_set_) {
|
||||
usage_property_set_.reset(new UsagePropertySet());
|
||||
@@ -1393,7 +1415,7 @@ CdmResponseType CdmEngine::GetUsageInfo(const std::string& app_id,
|
||||
LOGE("Output |usage_info| is null");
|
||||
return PARAMETER_NULL;
|
||||
}
|
||||
usage_property_set_->set_security_level(kLevelDefault);
|
||||
usage_property_set_->set_security_level(security_level);
|
||||
usage_property_set_->set_app_id(app_id);
|
||||
usage_session_.reset(new CdmSession(file_system_, metrics_->AddSession()));
|
||||
CdmResponseType status = usage_session_->Init(usage_property_set_.get());
|
||||
|
||||
Reference in New Issue
Block a user