From 79eabb098956f36a1022e2853993614d2c5752f3 Mon Sep 17 00:00:00 2001 From: Rahul Frias Date: Tue, 4 Aug 2020 15:02:06 -0700 Subject: [PATCH] Allow offline licenses to be loaded and restored in the same session [ Merge of http://go/wvgerrit/103243 ] Include review comments from wv gerrit CL. Bug: 161551490 Test: WV unit integration tests, GtsMediaTestCases and WidevineConcurrentDrmCertificatesTest#testConcurrentDrmCertificates, MediaDrmTest#testMultipleLoadKeys on a redfin Change-Id: Ie9b41a2e68b95692f9353578f6955637411d4dfc --- libwvdrmengine/cdm/core/src/cdm_session.cpp | 2 +- libwvdrmengine/cdm/test/request_license_test.cpp | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/libwvdrmengine/cdm/core/src/cdm_session.cpp b/libwvdrmengine/cdm/core/src/cdm_session.cpp index fbeec8cf..11c0b178 100644 --- a/libwvdrmengine/cdm/core/src/cdm_session.cpp +++ b/libwvdrmengine/cdm/core/src/cdm_session.cpp @@ -281,7 +281,7 @@ CdmResponseType CdmSession::RestoreOfflineSession(const CdmKeySetId& key_set_id, // We need to investigate the conditions that caused an app failure and // led us to add a test to support this use case as there were multiple // related issues. - if (!has_license_been_loaded_ && has_license_been_restored_) { + if (!has_license_been_loaded_ && has_license_been_restored_) { LOGE("Disallow multiple offline license restores"); return RESTORE_OFFLINE_LICENSE_ERROR_3; } diff --git a/libwvdrmengine/cdm/test/request_license_test.cpp b/libwvdrmengine/cdm/test/request_license_test.cpp index 099e17ff..11f36f7b 100644 --- a/libwvdrmengine/cdm/test/request_license_test.cpp +++ b/libwvdrmengine/cdm/test/request_license_test.cpp @@ -2709,8 +2709,7 @@ TEST_F(WvCdmRequestLicenseTest, AllowLoadAndRestoreOfflineKeyTest) { GenerateKeyRequest(key_id, kLicenseTypeOffline); VerifyKeyRequestResponse(config_.license_server(), client_auth); - CdmKeySetId key_set_id = key_set_id_; - EXPECT_EQ(wvcdm::KEY_ADDED, decryptor_->RestoreKey(session_id_, key_set_id)); + EXPECT_EQ(wvcdm::KEY_ADDED, decryptor_->RestoreKey(session_id_, key_set_id_)); decryptor_->CloseSession(session_id_); }