Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f5ef0acb authored by Yi Jin's avatar Yi Jin
Browse files

Define fields in incident header and add a new proto to log internal

incidentd metadata

Bug: 65451198
Test: N/A
Change-Id: Iaa3329ab06ccb2060f9e7a01d61bd8b808a507e1
parent 43be09b5
Loading
Loading
Loading
Loading
+10 −1
Original line number Original line Diff line number Diff line
@@ -45,12 +45,21 @@ import "frameworks/base/libs/incident/proto/android/section.proto";


package android.os;
package android.os;


// This field contains internal metadata associated with an incident report,
// such as the section ids and privacy policy specs from caller as well as how long
// and how many bytes a section takes, etc.
message IncidentMetadata {

}

// privacy field options must not be set at this level because all
// privacy field options must not be set at this level because all
// the sections are able to be controlled and configured by section ids.
// the sections are able to be controlled and configured by section ids.
// Instead privacy field options need to be configured in each section proto message.
// Instead privacy field options need to be configured in each section proto message.
message IncidentProto {
message IncidentProto {
    // Incident header
    // Incident header from callers
    repeated IncidentHeaderProto header = 1;
    repeated IncidentHeaderProto header = 1;
    // Internal metadata of incidentd
    optional IncidentMetadata metadata = 2;


    // Device information
    // Device information
    optional SystemPropertiesProto system_properties = 1000 [
    optional SystemPropertiesProto system_properties = 1000 [
+24 −8
Original line number Original line Diff line number Diff line
@@ -16,18 +16,34 @@


syntax = "proto2";
syntax = "proto2";
option java_multiple_files = true;
option java_multiple_files = true;
option java_outer_classname = "IncidentHeaderProtoMetadata";


package android.os;
package android.os;


// IncidentHeaderProto contains extra information the caller of incidentd want to
// attach in an incident report, the data should just be informative.
message IncidentHeaderProto {
message IncidentHeaderProto {
    enum Cause {
        CAUSE_UNKNOWN = 0;
        CAUSE_USER = 1;
        CAUSE_ANR = 2;
        CAUSE_CRASH = 3;
    }


    optional Cause cause = 1;
    // From statsd config, the name of the anomaly, usually human readable.
    optional string incident_name = 1;

    // Format a human readable reason why an incident report is requested.
    // It's optional and may directly come from a user clicking the bug-report button.
    optional string reason = 2;

    // From statsd, the metric which causes the anomaly triggered.
    optional string metric_name = 3;

    // From statsd, the metric value exceeds the threshold. This is useful for
    // ValueMetric and GaugeMetric.
    oneof metric_value {
        int64 int64_value = 4;
        double double_value = 5;
    }
    }


    // Defines which stats config used to fire the request.
    message StatsdConfigKey {
        optional int32 uid = 1;
        optional string name = 2;
    }
    optional StatsdConfigKey config_key = 6;
}