Recovery from usage info corruption
[ Merge of http://go/wvgerrit/46623 ] If corruption of the usage information file is detected while saving a streaming license with a PST, usage information file is deleted, so that a subsequent load keys may succeed. Also when calling the MediaDrm API releaseAllSecureStops(), an error would be returned if usage info file was corrupted. Since this file is deleted successfully, errors have been replaced with warnings. Bug: 73447733 Test: wv unit/integration tests Change-Id: Ie4a63ac202fd6009609105f38ffa8a3b23ed334e
This commit is contained in:
@@ -841,6 +841,25 @@ CdmResponseType CdmSession::StoreLicense() {
|
||||
key_set_id_, usage_entry_,
|
||||
usage_entry_number_)) {
|
||||
LOGE("CdmSession::StoreLicense: Unable to store usage info");
|
||||
// Usage info file is corrupt. Delete current usage entry and file.
|
||||
switch (usage_support_type_) {
|
||||
case kUsageEntrySupport:
|
||||
DeleteUsageEntry(usage_entry_number_);
|
||||
break;
|
||||
case kUsageTableSupport:
|
||||
crypto_session_->DeleteUsageInformation(provider_session_token);
|
||||
crypto_session_->UpdateUsageInformation();
|
||||
break;
|
||||
default:
|
||||
LOGW("CdmSession::StoreLicense: unexpected usage support type: %d",
|
||||
usage_support_type_);
|
||||
break;
|
||||
}
|
||||
std::vector<std::string> provider_session_tokens;
|
||||
file_handle_->DeleteAllUsageInfoForApp(
|
||||
DeviceFiles::GetUsageInfoFileName(app_id),
|
||||
&provider_session_tokens);
|
||||
|
||||
return STORE_USAGE_INFO_ERROR;
|
||||
}
|
||||
return NO_ERROR;
|
||||
|
||||
Reference in New Issue
Block a user