From 4028784836aefe1a63bae7d7d61c64d781044ded Mon Sep 17 00:00:00 2001 From: Alex Dale Date: Mon, 19 Oct 2020 22:41:06 -0700 Subject: [PATCH] Include "origin" in license request client ID [ Merge of http://go/wvgerrit/108823 ] Android CDM will include the session origin in the client info component of the client ID of a license request. The "origin" is only to be included on Android CDM, and not the CE CDM. The origin is provided to the license request via the app parameters in the WVDrmPlugin. A separate GTS test is in development and will be submitted to the Android media GTS test set. Bug: 164549928 Test: Manual test and GTS test Change-Id: I67f8b064b2aefdc08328ea14551d4aa4cb57023d --- libwvdrmengine/mediadrm/src_hidl/WVDrmPlugin.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/libwvdrmengine/mediadrm/src_hidl/WVDrmPlugin.cpp b/libwvdrmengine/mediadrm/src_hidl/WVDrmPlugin.cpp index 3066601e..079721fd 100644 --- a/libwvdrmengine/mediadrm/src_hidl/WVDrmPlugin.cpp +++ b/libwvdrmengine/mediadrm/src_hidl/WVDrmPlugin.cpp @@ -34,6 +34,7 @@ static const char* const kDisable = "disable"; static const std::string kPsshTag = "pssh"; static const char* const kSpecialUnprovisionResponse = "unprovision"; static const std::string kKeyAppPackageName = "application_name"; +static const std::string kKeyOrigin = "origin"; } // namespace @@ -520,9 +521,11 @@ Return WVDrmPlugin::getKeyRequest_1_2( cdmParameters[cdmKey] = cdmValue; } - // Inserting application name into parameters. This will overwrite user - // parameters of the same key. + // Inserting additional client ID parameters here, this will appear + // in the license request. + // Note: This will overwrite user parameters of the same key. cdmParameters[kKeyAppPackageName] = mAppPackageName; + cdmParameters[kKeyOrigin] = mCdmIdentifierBuilder.origin(); CdmKeyRequest keyRequest; CdmResponseType res = mCDM->GenerateKeyRequest( @@ -2122,12 +2125,9 @@ Status WVDrmPlugin::unprovision(const CdmIdentifier& identifier) { CdmResponseType res1 = mCDM->Unprovision(wvcdm::kSecurityLevelL1, identifier); CdmResponseType res3 = mCDM->Unprovision(wvcdm::kSecurityLevelL3, identifier); - if (!isCdmResponseTypeSuccess(res1)) - { + if (!isCdmResponseTypeSuccess(res1)) { return mapCdmResponseType(res1); - } - else - { + } else { return mapCdmResponseType(res3); } }