Fix Repository Inconsistencies from LMP
Back when we were being proactive about merging LMP changes to master in the Widevine repository, there were a few changes that got merged in a different form than what got checked into the Android repository. Mostly, this happened due to several large core changes that were brought over to the master branch in multiple parts so as not to break other teams using the Widevine repository. This patch brings the two trees in sync. Change-Id: I4e56a742686d73d1c6ace209684ce0e8542fd93f
This commit is contained in:
@@ -73,11 +73,17 @@ void CdmSession::Create(CdmLicense* license_parser,
|
||||
is_usage_update_needed_ = false;
|
||||
is_initial_decryption_ = true;
|
||||
has_decrypted_since_last_report_ = false;
|
||||
if (cdm_client_property_set) {
|
||||
requested_security_level_ = kLevelDefault;
|
||||
if (NULL != cdm_client_property_set) {
|
||||
if (QUERY_VALUE_SECURITY_LEVEL_L3.compare(
|
||||
cdm_client_property_set->security_level()) == 0) {
|
||||
requested_security_level_ = kLevel3;
|
||||
}
|
||||
Properties::AddSessionPropertySet(session_id_, cdm_client_property_set);
|
||||
}
|
||||
security_level_ = GetRequestedSecurityLevel() == kLevel3 ? kSecurityLevelL3
|
||||
: GetSecurityLevel();
|
||||
security_level_ =
|
||||
GetRequestedSecurityLevel() == kLevel3 ? kSecurityLevelL3
|
||||
: kSecurityLevelUninitialized;
|
||||
app_id_.clear();
|
||||
}
|
||||
|
||||
@@ -92,8 +98,9 @@ CdmResponseType CdmSession::Init() {
|
||||
LOGE("CdmSession::Init: Failed due to previous initialization");
|
||||
return UNKNOWN_ERROR;
|
||||
}
|
||||
CdmResponseType sts = crypto_session_->Open(GetRequestedSecurityLevel());
|
||||
CdmResponseType sts = crypto_session_->Open(requested_security_level_);
|
||||
if (NO_ERROR != sts) return sts;
|
||||
security_level_ = crypto_session_->GetSecurityLevel();
|
||||
|
||||
std::string token;
|
||||
if (Properties::use_certificates_as_identification()) {
|
||||
@@ -293,7 +300,7 @@ CdmResponseType CdmSession::QueryStatus(CdmQueryMap* key_info) {
|
||||
return UNKNOWN_ERROR;
|
||||
}
|
||||
|
||||
switch (crypto_session_->GetSecurityLevel()) {
|
||||
switch (security_level_) {
|
||||
case kSecurityLevelL1:
|
||||
(*key_info)[QUERY_KEY_SECURITY_LEVEL] = QUERY_VALUE_SECURITY_LEVEL_L1;
|
||||
break;
|
||||
@@ -588,23 +595,6 @@ void CdmSession::GetApplicationId(std::string* app_id) {
|
||||
}
|
||||
}
|
||||
|
||||
SecurityLevel CdmSession::GetRequestedSecurityLevel() {
|
||||
std::string security_level;
|
||||
if (Properties::GetSecurityLevel(session_id_, &security_level) &&
|
||||
security_level == QUERY_VALUE_SECURITY_LEVEL_L3) {
|
||||
return kLevel3;
|
||||
}
|
||||
|
||||
return kLevelDefault;
|
||||
}
|
||||
|
||||
CdmSecurityLevel CdmSession::GetSecurityLevel() {
|
||||
if (NULL == crypto_session_.get())
|
||||
return kSecurityLevelUninitialized;
|
||||
|
||||
return crypto_session_.get()->GetSecurityLevel();
|
||||
}
|
||||
|
||||
CdmResponseType CdmSession::DeleteUsageInformation(const std::string& app_id) {
|
||||
if (!file_handle_->Reset(security_level_)) {
|
||||
LOGE("CdmSession::StoreLicense: Unable to initialize device files");
|
||||
|
||||
Reference in New Issue
Block a user