Correct an error reported when a license is restored and then released

[ Merge of http://go/wvgerrit/128143 ]

Now reports LICENSE_STATE_ERROR rather than ERROR_DRM_GENERIC_PLUGIN
to make the cause of failure and suggested action more clear for app
developers. Also added an additional error log.

Bug: 190645000
Test: WV unit/integration tests
Change-Id: Ib23ca628c590316f90f497d8fdfbab24fd644d6f
This commit is contained in:
Rahul Frias
2021-06-29 20:21:06 -07:00
parent 61218ec6cf
commit c882bd8230
6 changed files with 15 additions and 1 deletions

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;