Add a field indicating online vs offline licenses.
Import of http://go/wvgerrit/68188 This adds an attribute to metrics indicating if the license was online or offline. Also, added a unit test for CdmEngineMetricsImpl. Test: Unit tests. GPlay manual. GTS tests. Bug: 115523917 Change-Id: Id315c643048914a2c51904451f9665987bc87eb7
This commit is contained in:
@@ -30,6 +30,7 @@ const char kAttributeOemCryptoResult[] = "oem_crypto_result";
|
||||
const char kAttributeKeyStatusType[] = "key_status_type";
|
||||
const char kAttributeEventType[] = "event_type";
|
||||
const char kAttributeKeyRequestType[] = "key_request_type";
|
||||
const char kAttributeLicenseType[] = "license_type";
|
||||
|
||||
template<typename T>
|
||||
void SetValue(const T& value, DrmMetricGroup::Attribute* attribute);
|
||||
@@ -237,6 +238,12 @@ void HidlMetricsGroupBuilder::AddAttributes(
|
||||
DrmMetricGroup::ValueType::INT64_TYPE,
|
||||
attributes_proto.key_request_type(), &attribute_vector);
|
||||
}
|
||||
if (attributes_proto.has_license_type()) {
|
||||
AddAttribute(
|
||||
kAttributeLicenseType,
|
||||
DrmMetricGroup::ValueType::INT64_TYPE,
|
||||
attributes_proto.license_type(), &attribute_vector);
|
||||
}
|
||||
|
||||
*attributes = attribute_vector;
|
||||
}
|
||||
|
||||
@@ -281,6 +281,7 @@ TEST(HidlMetricsAdapterTest, AddAllAttrbitues) {
|
||||
attributes->set_key_status_type(43);
|
||||
attributes->set_event_type(47);
|
||||
attributes->set_key_request_type(53);
|
||||
attributes->set_license_type(59);
|
||||
|
||||
DrmMetricGroup::Metric expected_counter_metric = {
|
||||
"crypto_session_get_token",
|
||||
@@ -302,7 +303,9 @@ TEST(HidlMetricsAdapterTest, AddAllAttrbitues) {
|
||||
DrmMetricGroup::ValueType::INT64_TYPE, 43, 0, "" },
|
||||
{ "event_type", DrmMetricGroup::ValueType::INT64_TYPE, 47, 0, "" },
|
||||
{ "key_request_type",
|
||||
DrmMetricGroup::ValueType::INT64_TYPE, 53, 0, "" } },
|
||||
DrmMetricGroup::ValueType::INT64_TYPE, 53, 0, "" },
|
||||
{ "license_type",
|
||||
DrmMetricGroup::ValueType::INT64_TYPE, 59, 0, "" } },
|
||||
{ { "count", DrmMetricGroup::ValueType::INT64_TYPE, 13, 0, "" } } };
|
||||
|
||||
// Confirm that all of the attributes exist in the hidl data.
|
||||
|
||||
Reference in New Issue
Block a user