diff options
author | Yi Jin <jinyithu@google.com> | 2018-06-22 16:51:40 -0700 |
---|---|---|
committer | Yi Jin <jinyithu@google.com> | 2018-06-22 16:51:40 -0700 |
commit | 908c02f5c15d21406b282c7946cee2c87685b640 (patch) | |
tree | da31bb3326c5526995ea7141d24a9320ab449191 /tools/incident_section_gen/main.cpp | |
parent | 6b1c5e923f5fb8ce0cf74bcb7e7e035e0da9b5b5 (diff) |
Add kernel version to incident report
Bug: 110230810
Test: atest incidentd_test
Change-Id: I502b34f23d61a7346d79ff0dc378add8461d2d27
Diffstat (limited to 'tools/incident_section_gen/main.cpp')
-rw-r--r-- | tools/incident_section_gen/main.cpp | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/tools/incident_section_gen/main.cpp b/tools/incident_section_gen/main.cpp index 1f77719ea4d5..639f98062b71 100644 --- a/tools/incident_section_gen/main.cpp +++ b/tools/incident_section_gen/main.cpp @@ -110,9 +110,7 @@ static bool generateIncidentSectionsCpp(Descriptor const* descriptor) N = descriptor->field_count(); for (int i=0; i<N; i++) { const FieldDescriptor* field = descriptor->field(i); - if (field->type() == FieldDescriptor::TYPE_MESSAGE) { - sections[field->name()] = field; - } + sections[field->name()] = field; } printf("IncidentSection const INCIDENT_SECTIONS[] = {\n"); @@ -404,7 +402,7 @@ static bool generateSectionListCpp(Descriptor const* descriptor) { for (int i=0; i<descriptor->field_count(); i++) { const FieldDescriptor* field = descriptor->field(i); - if (field->type() != FieldDescriptor::TYPE_MESSAGE) { + if (field->type() != FieldDescriptor::TYPE_MESSAGE && field->type() != FieldDescriptor::TYPE_STRING) { continue; } const SectionFlags s = getSectionFlags(field); @@ -456,13 +454,13 @@ static bool generateSectionListCpp(Descriptor const* descriptor) { const FieldDescriptor* field = fieldsInOrder[i]; const string fieldName = getFieldName(field); const Destination fieldDest = getFieldDest(field); - const string fieldMessageName = getMessageName(field->message_type(), fieldDest); - - skip[i] = true; - if (field->type() != FieldDescriptor::TYPE_MESSAGE) { + printPrivacy(fieldName, field, "NULL", fieldDest, "NULL"); continue; } + + skip[i] = true; + const string fieldMessageName = getMessageName(field->message_type(), fieldDest); // generate privacy flags for each section. if (generatePrivacyFlags(field->message_type(), fieldDest, variableNames, &parents)) { printPrivacy(fieldName, field, fieldMessageName, fieldDest, "NULL"); |