Dump error_detail in dumpsys

Merged from http://go/wvgerrit/162420

Test: adb shell dumpsys android.hardware.drm.IDrmFactory/widevine

Bug: 260241061
Change-Id: I28b06b201c3408d85f6ca944534ad9602bc60a85
This commit is contained in:
Edwin Wong
2022-11-27 18:17:50 +00:00
parent 6d3457b9d9
commit 927053d6e8
2 changed files with 10 additions and 0 deletions

View File

@@ -33,6 +33,7 @@ const char kAttributeKeyStatusType[] = "key_status_type";
const char kAttributeEventType[] = "event_type";
const char kAttributeKeyRequestType[] = "key_request_type";
const char kAttributeLicenseType[] = "license_type";
const char kAttributeErrorDetail[] = "error_detail";
template <typename T>
void SetValue(const T& value, DrmMetricNamedValue* attribute);
@@ -239,6 +240,10 @@ void WvMetricsGroupBuilder::AddAttributes(
AddAttribute(kAttributeLicenseType, attributes_proto.license_type(),
&attribute_vector);
}
if (attributes_proto.has_error_detail()) {
AddAttribute(kAttributeErrorDetail, attributes_proto.error_detail(),
&attribute_vector);
}
*attributes = attribute_vector;
}

View File

@@ -226,6 +226,11 @@ string FormatAttributes(const string& indent, const Attributes& attributes) {
result.append("license_type: ");
result.append(to_string(attributes.license_type()));
}
if (attributes.has_error_detail()) {
result.assign(indent);
result.append("error_detail: ");
result.append(to_string(attributes.error_detail()));
}
if (result.size()) {
return result;
} else {