Report Widevine Version on Android
(This is a merge of http://go/wvgerrit/29282) The Android API has long mandated that plugins respond to queries for a version number, but we'd never hooked it up to the CDM's actual version number until now. Bug: 36867286 Test: libwvdrmdrmplugin_test Test: libwvdrmdrmplugin_hidl_test Change-Id: I952de4943f8e78b44d526bee66c54d31e9fe5ff1
This commit is contained in:
@@ -476,7 +476,7 @@ status_t WVDrmPlugin::getPropertyString(const String8& name,
|
||||
if (name == "vendor") {
|
||||
value = "Google";
|
||||
} else if (name == "version") {
|
||||
value = "1.0";
|
||||
return queryProperty(QUERY_KEY_WVCDM_VERSION, value);
|
||||
} else if (name == "description") {
|
||||
value = "Widevine CDM";
|
||||
} else if (name == "algorithms") {
|
||||
|
||||
@@ -640,7 +640,7 @@ Return<void> WVDrmPlugin::getPropertyString(const hidl_string& propertyName,
|
||||
if (name == "vendor") {
|
||||
value = "Google";
|
||||
} else if (name == "version") {
|
||||
value = "1.0";
|
||||
status = queryProperty(wvcdm::QUERY_KEY_WVCDM_VERSION, value);
|
||||
} else if (name == "description") {
|
||||
value = "Widevine CDM";
|
||||
} else if (name == "algorithms") {
|
||||
|
||||
@@ -104,6 +104,7 @@ using wvcdm::QUERY_KEY_PROVISIONING_ID;
|
||||
using wvcdm::QUERY_KEY_SECURITY_LEVEL;
|
||||
using wvcdm::QUERY_KEY_SRM_UPDATE_SUPPORT;
|
||||
using wvcdm::QUERY_KEY_SYSTEM_ID;
|
||||
using wvcdm::QUERY_KEY_WVCDM_VERSION;
|
||||
using wvcdm::QUERY_VALUE_SECURITY_LEVEL_L1;
|
||||
using wvcdm::QUERY_VALUE_SECURITY_LEVEL_L3;
|
||||
using wvcdm::SecurityLevel;
|
||||
@@ -1080,6 +1081,7 @@ TEST_F(WVDrmPluginTest, ReturnsExpectedPropertyValues) {
|
||||
static const std::string maxSessions = "54";
|
||||
static const std::string oemCryptoApiVersion = "13";
|
||||
static const std::string currentSRMVersion = "1";
|
||||
static const std::string cdmVersion = "Infinity Minus 1";
|
||||
std::string serializedMetrics(
|
||||
kSerializedMetrics, kSerializedMetrics + sizeof(kSerializedMetrics));
|
||||
|
||||
@@ -1121,6 +1123,10 @@ TEST_F(WVDrmPluginTest, ReturnsExpectedPropertyValues) {
|
||||
.WillOnce(DoAll(SetArgPointee<2>(currentSRMVersion),
|
||||
testing::Return(wvcdm::NO_ERROR)));
|
||||
|
||||
EXPECT_CALL(*cdm, QueryStatus(_, QUERY_KEY_WVCDM_VERSION, _))
|
||||
.WillOnce(DoAll(SetArgPointee<2>(cdmVersion),
|
||||
testing::Return(wvcdm::NO_ERROR)));
|
||||
|
||||
EXPECT_CALL(*cdm, GetSerializedMetrics(_))
|
||||
.WillOnce(SetArgPointee<0>(serializedMetrics));
|
||||
|
||||
@@ -1137,7 +1143,7 @@ TEST_F(WVDrmPluginTest, ReturnsExpectedPropertyValues) {
|
||||
plugin.getPropertyString(
|
||||
hidl_string("version"), [&](Status status, hidl_string stringResult) {
|
||||
ASSERT_EQ(Status::OK, status);
|
||||
EXPECT_STREQ("1.0", stringResult.c_str());
|
||||
EXPECT_STREQ(cdmVersion.c_str(), stringResult.c_str());
|
||||
});
|
||||
|
||||
plugin.getPropertyString(
|
||||
|
||||
@@ -849,6 +849,7 @@ TEST_F(WVDrmPluginTest, ReturnsExpectedPropertyValues) {
|
||||
static const string maxSessions = "18";
|
||||
static const string oemCryptoApiVersion = "10";
|
||||
static const string currentSRMVersion = "1";
|
||||
static const string cdmVersion = "Infinity Minus 1";
|
||||
string serializedMetrics(kSerializedMetrics,
|
||||
kSerializedMetrics + sizeof(kSerializedMetrics));
|
||||
|
||||
@@ -890,6 +891,10 @@ TEST_F(WVDrmPluginTest, ReturnsExpectedPropertyValues) {
|
||||
.WillOnce(DoAll(SetArgPointee<2>(currentSRMVersion),
|
||||
testing::Return(wvcdm::NO_ERROR)));
|
||||
|
||||
EXPECT_CALL(*cdm, QueryStatus(_, QUERY_KEY_WVCDM_VERSION, _))
|
||||
.WillOnce(DoAll(SetArgPointee<2>(cdmVersion),
|
||||
Return(wvcdm::NO_ERROR)));
|
||||
|
||||
EXPECT_CALL(*cdm, GetSerializedMetrics(_))
|
||||
.WillOnce(SetArgPointee<0>(serializedMetrics));
|
||||
|
||||
@@ -902,7 +907,7 @@ TEST_F(WVDrmPluginTest, ReturnsExpectedPropertyValues) {
|
||||
|
||||
res = plugin.getPropertyString(String8("version"), stringResult);
|
||||
ASSERT_EQ(OK, res);
|
||||
EXPECT_STREQ("1.0", stringResult.string());
|
||||
EXPECT_STREQ(cdmVersion.c_str(), stringResult.string());
|
||||
|
||||
res = plugin.getPropertyString(String8("description"), stringResult);
|
||||
ASSERT_EQ(OK, res);
|
||||
|
||||
Reference in New Issue
Block a user