Added CDM support for Watermarking reporting.
[ Merge of http://go/wvgerrit/148552 ] Extended the CDM layer to report OEMCrypto's watermarking support. The reporting of watermarking comes in three (3) mechanisms: 1) ClientCapabilities in license requests 2) CryptoSession metrics when queried to OEMCrypto 3) String property query by apps If OEMCrypto implementents OEMCrypto_GetWatermarkingSupport(), then the reported watermarking support by the CDM will match that of OEMCrypto. If OEMCrypto does not implement OEMCrypto_GetWatermarkingSupport() or an error occurs, it is assumed that OEMCrypto does not support watermarking, and the CDM will report "Not Supported". Bug: 226443788 Test: run_x86_64_tests request_license_test and license_unittest Change-Id: Id929a356c395e6bcf45d371ee6887eec40d35329
This commit is contained in:
@@ -297,6 +297,7 @@ class CryptoMetrics {
|
||||
oemcrypto_generate_certificate_key_pair_;
|
||||
EventMetric<kOemCryptoResultFieldNumber, OEMCryptoResult>
|
||||
oemcrypto_install_oem_private_key_;
|
||||
ValueMetric<int> oemcrypto_watermarking_support_;
|
||||
}; // class CryptoMetrics
|
||||
|
||||
// This class contains session-scoped metrics. All properties and
|
||||
|
||||
@@ -209,6 +209,8 @@ void CryptoMetrics::Serialize(
|
||||
oemcrypto_minor_api_version_.ToProto());
|
||||
crypto_metrics->set_allocated_oemcrypto_maximum_usage_table_header_size(
|
||||
oemcrypto_maximum_usage_table_header_size_.ToProto());
|
||||
crypto_metrics->set_allocated_oemcrypto_watermarking_support(
|
||||
oemcrypto_watermarking_support_.ToProto());
|
||||
}
|
||||
|
||||
SessionMetrics::SessionMetrics() : session_id_(""), completed_(false) {}
|
||||
|
||||
@@ -92,7 +92,7 @@ message WvCdmMetrics {
|
||||
|
||||
// This contains metrics that were captured at the CryptoSession level. These
|
||||
// include CryptoSession metrics and most OEMCrypto metrics.
|
||||
// next id: 85
|
||||
// next id: 86
|
||||
message CryptoMetrics {
|
||||
// Crypto Session Metrics.
|
||||
optional ValueMetric crypto_session_security_level = 1;
|
||||
@@ -192,6 +192,7 @@ message WvCdmMetrics {
|
||||
repeated DistributionMetric oemcrypto_load_provisioning_time_us = 82;
|
||||
optional ValueMetric oemcrypto_minor_api_version = 83;
|
||||
optional ValueMetric oemcrypto_maximum_usage_table_header_size = 84;
|
||||
optional ValueMetric oemcrypto_watermarking_support = 85;
|
||||
}
|
||||
|
||||
// This contains metrics that were captured within a CdmSession. This contains
|
||||
|
||||
@@ -443,6 +443,8 @@ TEST_F(CryptoMetricsTest, AllCryptoMetrics) {
|
||||
crypto_metrics.oemcrypto_resource_rating_tier_.Record(123);
|
||||
crypto_metrics.oemcrypto_minor_api_version_.Record(234);
|
||||
crypto_metrics.oemcrypto_maximum_usage_table_header_size_.Record(321);
|
||||
crypto_metrics.oemcrypto_watermarking_support_.Record(
|
||||
OEMCrypto_WatermarkingAlwaysOn);
|
||||
|
||||
WvCdmMetrics::CryptoMetrics actual;
|
||||
crypto_metrics.Serialize(&actual);
|
||||
@@ -534,6 +536,8 @@ TEST_F(CryptoMetricsTest, AllCryptoMetrics) {
|
||||
EXPECT_EQ(234, actual.oemcrypto_minor_api_version().int_value());
|
||||
EXPECT_EQ(321,
|
||||
actual.oemcrypto_maximum_usage_table_header_size().int_value());
|
||||
EXPECT_EQ(static_cast<int>(OEMCrypto_WatermarkingAlwaysOn),
|
||||
actual.oemcrypto_watermarking_support().int_value());
|
||||
}
|
||||
} // namespace metrics
|
||||
} // namespace wvcdm
|
||||
|
||||
Reference in New Issue
Block a user