Revise a few metrics and add unit tests.
This is a merge of Widevine cl 39040. A few of the metrics were not implemented, or implemented incorrectly in O MR1. This cleans them up Bug: 64001676 Test: Re-ran unit tests and added some additional tests. GPlay Movies check. Change-Id: I1e8bcc36fecd76e72d853306075bc46d82f45161
This commit is contained in:
@@ -128,7 +128,6 @@ class CryptoMetrics {
|
||||
CounterMetric<OEMCryptoResult> oemcrypto_get_oem_public_certificate_;
|
||||
CounterMetric<OEMCryptoResult> oemcrypto_get_random_;
|
||||
EventMetric<OEMCryptoResult> oemcrypto_initialize_;
|
||||
EventMetric<OEMCryptoResult> oemcrypto_install_keybox_;
|
||||
ValueMetric<bool> oemcrypto_is_anti_rollback_hw_present_;
|
||||
ValueMetric<bool> oemcrypto_is_keybox_valid_;
|
||||
EventMetric<OEMCryptoResult> oemcrypto_load_device_rsa_key_;
|
||||
@@ -143,9 +142,8 @@ class CryptoMetrics {
|
||||
EventMetric<OEMCryptoResult> oemcrypto_rewrap_device_rsa_key_30_;
|
||||
ValueMetric<uint16_t> oemcrypto_security_patch_level_;
|
||||
EventMetric<OEMCryptoResult> oemcrypto_select_key_;
|
||||
ValueMetric<bool> oemcrypto_supports_usage_table_;
|
||||
ValueMetric<CdmUsageSupportType> oemcrypto_usage_table_support_;
|
||||
CounterMetric<OEMCryptoResult> oemcrypto_update_usage_table_;
|
||||
EventMetric<OEMCryptoResult> oemcrypto_wrap_keybox_;
|
||||
};
|
||||
|
||||
// This class contains session-scoped metrics. All properties and
|
||||
|
||||
@@ -189,9 +189,6 @@ CryptoMetrics::CryptoMetrics() :
|
||||
oemcrypto_initialize_(
|
||||
"/drm/widevine/oemcrypto/initialize/time",
|
||||
"oemcrypto_error"),
|
||||
oemcrypto_install_keybox_(
|
||||
"/drm/widevine/oemcrypto/install_keybox/time",
|
||||
"oemcrypto_error"),
|
||||
oemcrypto_is_anti_rollback_hw_present_(
|
||||
"/drm/widevine/oemcrypto/is_anti_rollback_hw_present"),
|
||||
oemcrypto_is_keybox_valid_(
|
||||
@@ -227,13 +224,10 @@ CryptoMetrics::CryptoMetrics() :
|
||||
oemcrypto_select_key_(
|
||||
"/drm/widevine/oemcrypto/select_key/time",
|
||||
"oemcrypto_error"),
|
||||
oemcrypto_supports_usage_table_(
|
||||
"/drm/widevine/oemcrypto/supports_usage_table"),
|
||||
oemcrypto_usage_table_support_(
|
||||
"/drm/widevine/oemcrypto/usage_table_support"),
|
||||
oemcrypto_update_usage_table_(
|
||||
"/drm/widevine/oemcrypto/update_usage_table",
|
||||
"oemcrypto_error"),
|
||||
oemcrypto_wrap_keybox_(
|
||||
"/drm/widevine/oemcrypto/wrap_keybox/time",
|
||||
"oemcrypto_error") {
|
||||
}
|
||||
|
||||
@@ -280,7 +274,6 @@ void CryptoMetrics::Serialize(MetricsGroup* metrics) {
|
||||
oemcrypto_get_oem_public_certificate_.Serialize(&serializer);
|
||||
oemcrypto_get_random_.Serialize(&serializer);
|
||||
oemcrypto_initialize_.Serialize(&serializer);
|
||||
oemcrypto_install_keybox_.Serialize(&serializer);
|
||||
oemcrypto_is_anti_rollback_hw_present_.Serialize(&serializer);
|
||||
oemcrypto_is_keybox_valid_.Serialize(&serializer);
|
||||
oemcrypto_load_device_rsa_key_.Serialize(&serializer);
|
||||
@@ -295,9 +288,8 @@ void CryptoMetrics::Serialize(MetricsGroup* metrics) {
|
||||
oemcrypto_rewrap_device_rsa_key_30_.Serialize(&serializer);
|
||||
oemcrypto_security_patch_level_.Serialize(&serializer);
|
||||
oemcrypto_select_key_.Serialize(&serializer);
|
||||
oemcrypto_supports_usage_table_.Serialize(&serializer);
|
||||
oemcrypto_usage_table_support_.Serialize(&serializer);
|
||||
oemcrypto_update_usage_table_.Serialize(&serializer);
|
||||
oemcrypto_wrap_keybox_.Serialize(&serializer);
|
||||
}
|
||||
|
||||
SessionMetrics::SessionMetrics() :
|
||||
|
||||
@@ -110,6 +110,14 @@ void Serialize<OEMCryptoInitializationMode>(
|
||||
serializer->SetInt32(metric_name, value);
|
||||
}
|
||||
|
||||
template<>
|
||||
void Serialize<CdmUsageSupportType>(
|
||||
MetricSerializer* serializer,
|
||||
const std::string& metric_name,
|
||||
const CdmUsageSupportType& value) {
|
||||
serializer->SetInt32(metric_name, value);
|
||||
}
|
||||
|
||||
} // namespace impl
|
||||
} // namespace metrics
|
||||
} // namespace wvcdm
|
||||
|
||||
Reference in New Issue
Block a user