Merge "Allow Reloading Partially-Released Licenses"

This commit is contained in:
John Bruce
2018-10-12 03:10:31 +00:00
committed by Android (Google) Code Review
2 changed files with 10 additions and 3 deletions

View File

@@ -60,7 +60,7 @@ class CdmSession {
WvCdmEventListener* event_listener); WvCdmEventListener* event_listener);
virtual CdmResponseType RestoreOfflineSession( virtual CdmResponseType RestoreOfflineSession(
const CdmKeySetId& key_set_id, const CdmLicenseType license_type); const CdmKeySetId& key_set_id, CdmLicenseType license_type);
virtual CdmResponseType RestoreUsageSession( virtual CdmResponseType RestoreUsageSession(
const DeviceFiles::CdmUsageData& usage_data); const DeviceFiles::CdmUsageData& usage_data);

View File

@@ -186,7 +186,7 @@ CdmResponseType CdmSession::Init(CdmClientPropertySet* cdm_client_property_set,
} }
CdmResponseType CdmSession::RestoreOfflineSession( CdmResponseType CdmSession::RestoreOfflineSession(
const CdmKeySetId& key_set_id, const CdmLicenseType license_type) { const CdmKeySetId& key_set_id, CdmLicenseType license_type) {
if (!initialized_) { if (!initialized_) {
LOGE("CdmSession::RestoreOfflineSession: not initialized"); LOGE("CdmSession::RestoreOfflineSession: not initialized");
return NOT_INITIALIZED_ERROR; return NOT_INITIALIZED_ERROR;
@@ -214,7 +214,14 @@ CdmResponseType CdmSession::RestoreOfflineSession(
return GET_LICENSE_ERROR; return GET_LICENSE_ERROR;
} }
// Do not restore a released offline license, unless a release retry // Attempts to restore a released offline license are treated as a release
// retry.
if (license_state == DeviceFiles::kLicenseStateReleasing) {
license_type = kLicenseTypeRelease;
}
// Only restore offline licenses if they are active or this is a release
// retry.
if (!(license_type == kLicenseTypeRelease || if (!(license_type == kLicenseTypeRelease ||
license_state == DeviceFiles::kLicenseStateActive)) { license_state == DeviceFiles::kLicenseStateActive)) {
LOGE( LOGE(