Merge "Correct an error reported when a license is restored and then released" into sc-dev

This commit is contained in:
Rahul Frias
2021-07-01 19:17:21 +00:00
committed by Android (Google) Code Review
6 changed files with 15 additions and 1 deletions

View File

@@ -420,6 +420,7 @@ enum CdmResponseType : int32_t {
CERT_PROVISIONING_RESPONSE_ERROR_9 = 365,
CERT_PROVISIONING_RESPONSE_ERROR_10 = 366,
CLIENT_TOKEN_NOT_SET = 367,
USAGE_ENTRY_ALREADY_LOADED = 368,
// Don't forget to add new values to
// * core/test/test_printers.cpp.
// * android/include/mapErrors-inl.h

View File

@@ -283,6 +283,11 @@ CdmResponseType CdmSession::RestoreOfflineSession(const CdmKeySetId& key_set_id,
CdmResponseType sts = usage_table_header_->LoadEntry(
crypto_session_.get(), usage_entry_, usage_entry_number_);
crypto_metrics_->usage_table_header_load_entry_.Increment(sts);
if (sts == LOAD_USAGE_ENTRY_INVALID_SESSION) {
LOGE("License loaded in different session: key_set_id = %s",
IdToString(key_set_id));
return USAGE_ENTRY_ALREADY_LOADED;
}
if (sts != NO_ERROR) {
LOGE("Failed to load usage entry: status = %d", static_cast<int>(sts));
return sts;

View File

@@ -887,6 +887,9 @@ void PrintTo(const enum CdmResponseType& value, ::std::ostream* os) {
case USAGE_ENTRY_NUMBER_MISMATCH:
*os << "USAGE_ENTRY_NUMBER_MISMATCH";
break;
case USAGE_ENTRY_ALREADY_LOADED:
*os << "USAGE_ENTRY_ALREADY_LOADED";
break;
case USAGE_GET_ENTRY_RETRIEVE_INVALID_STORAGE_TYPE:
*os << "USAGE_GET_ENTRY_RETRIEVE_INVALID_STORAGE_TYPE";
break;