Add securityLevel to MediaDrm isCryptoSchemeSupported API

bug:110701831
test: cts media test cases, widevine integration tests

Change-Id: I4a8973537b4b90740cdaf79a36e73943bcf074fb
This commit is contained in:
Jeff Tinker
2019-01-18 19:30:41 -08:00
parent 45b3f5761e
commit bf6245967e
3 changed files with 22 additions and 0 deletions

View File

@@ -24,6 +24,11 @@ struct WVDrmFactory : public IDrmFactory {
Return<bool> isCryptoSchemeSupported(const hidl_array<uint8_t, 16>& uuid)
override;
Return<bool> isCryptoSchemeSupported_1_2(const hidl_array<uint8_t, 16>& uuid,
const hidl_string& mimeType,
SecurityLevel level)
override;
Return<bool> isContentTypeSupported(const hidl_string &mimeType)
override;

View File

@@ -31,6 +31,15 @@ Return<bool> WVDrmFactory::isCryptoSchemeSupported(
return isWidevineUUID(uuid.data());
}
Return<bool> WVDrmFactory::isCryptoSchemeSupported_1_2(
const hidl_array<uint8_t, 16>& uuid,
const hidl_string& initDataType,
SecurityLevel level) {
return isWidevineUUID(uuid.data()) &&
isContentTypeSupported(initDataType)
/* TODO: jtinker@ b/117104043 && wvcdm::IsSecurityLevelSupported(level)*/;
}
Return<bool> WVDrmFactory::isContentTypeSupported(
const hidl_string& initDataType) {
return wvcdm::WvContentDecryptionModule::IsSupported(initDataType.c_str());

View File

@@ -95,6 +95,14 @@ TEST(WVDrmFactoryTest, DoesNotSupportUnsupportedContainerFormats) {
"WVPluginFactory incorrectly claims to support WMV";
}
TEST(WVDrmFactoryTest, SupportsSupportedCryptoSchemeWithLevel) {
WVDrmFactory factory;
EXPECT_TRUE(factory.isCryptoSchemeSupported_1_2(kWidevineUUID, hidl_string("video/mp4"),
android::hardware::drm::V1_1::SecurityLevel::SW_SECURE_CRYPTO)) <<
"WVPluginFactory does not support Widevine's UUID for video/mp4 and SW_SECURE_CRYPTO";
}
TEST(WVDrmFactoryTest, CalculatesSpoidUseCorrectly) {
WVDrmFactory factory;