L1 System Lowered to L3 Still Requires Secure Decoders
Merge of https://widevine-internal-review.googlesource.com/#/c/8263 from the Widevine repo. Changes the behavior of requiresSecureDecoderComponent() to query the session for whether a lowered security level has been requested before querying the system to see what its default security level is. As part of this, we added a new QuerySessionStatus() method to the CDM that gets status info on a session-specific level, such as the effective security level of a session. Bug: 11428937 Change-Id: I5549a2fdd400cc87f567d27fcf74c473451093d6
This commit is contained in:
committed by
John Bruce
parent
0a9f0b1dd8
commit
fd482527e4
@@ -50,7 +50,7 @@ bool WVCryptoPlugin::requiresSecureDecoderComponent(const char* mime) const {
|
||||
// Type is video, so query CDM to see if we require a secure decoder.
|
||||
CdmQueryMap status;
|
||||
|
||||
CdmResponseType res = mCDM->QueryStatus(&status);
|
||||
CdmResponseType res = mCDM->QuerySessionStatus(mSessionId, &status);
|
||||
|
||||
if (!isCdmResponseTypeSuccess(res)) {
|
||||
ALOGE("Error querying CDM status: %u", res);
|
||||
|
||||
@@ -27,7 +27,8 @@ class MockCDM : public WvContentDecryptionModule {
|
||||
MOCK_METHOD2(Decrypt, CdmResponseType(const CdmSessionId&,
|
||||
const CdmDecryptionParameters&));
|
||||
|
||||
MOCK_METHOD1(QueryStatus, CdmResponseType(CdmQueryMap*));
|
||||
MOCK_METHOD2(QuerySessionStatus, CdmResponseType(const CdmSessionId&,
|
||||
CdmQueryMap*));
|
||||
};
|
||||
|
||||
class WVCryptoPluginTest : public Test {
|
||||
@@ -55,10 +56,10 @@ TEST_F(WVCryptoPluginTest, CorrectlyReportsSecureBuffers) {
|
||||
CdmQueryMap l3Map;
|
||||
l3Map[QUERY_KEY_SECURITY_LEVEL] = QUERY_VALUE_SECURITY_LEVEL_L3;
|
||||
|
||||
EXPECT_CALL(cdm, QueryStatus(_))
|
||||
.WillOnce(DoAll(SetArgPointee<0>(l1Map),
|
||||
EXPECT_CALL(cdm, QuerySessionStatus(_, _))
|
||||
.WillOnce(DoAll(SetArgPointee<1>(l1Map),
|
||||
Return(wvcdm::NO_ERROR)))
|
||||
.WillOnce(DoAll(SetArgPointee<0>(l3Map),
|
||||
.WillOnce(DoAll(SetArgPointee<1>(l3Map),
|
||||
Return(wvcdm::NO_ERROR)));
|
||||
|
||||
EXPECT_TRUE(plugin.requiresSecureDecoderComponent("video/mp4")) <<
|
||||
|
||||
Reference in New Issue
Block a user