summaryrefslogtreecommitdiff
path: root/tools/incident_section_gen/main.cpp
diff options
context:
space:
mode:
authorYi Jin <jinyithu@google.com>2018-04-16 16:13:04 -0700
committerYi Jin <jinyithu@google.com>2018-05-02 01:31:08 +0000
commit7fe3dee3ae1cc47b50c4001cbac56c4fefbcc57b (patch)
treec8cfc01b6b323699295c269ea40e597f1dc15a59 /tools/incident_section_gen/main.cpp
parent82c0b73e98a81e4b2d2f50da44112381bcef6755 (diff)
Add a section flag to bypass failure if a specific path can't be found.
This is a temporary solution to bypass failure of reading cpu info or battery type in P if the path doesn't exist on some devices. See bug for details. However in Q, incidentd should implement reading from the common Linux kernel interfaces. Bug: 78028767 Bug: 78239764 Test: atest incidentd_test Change-Id: I08ffcb21709efe5478d2ac46121deb5795af1024 Merged-In: I08ffcb21709efe5478d2ac46121deb5795af1024
Diffstat (limited to 'tools/incident_section_gen/main.cpp')
-rw-r--r--tools/incident_section_gen/main.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/tools/incident_section_gen/main.cpp b/tools/incident_section_gen/main.cpp
index a274a8c7bf9a..3f9588acf827 100644
--- a/tools/incident_section_gen/main.cpp
+++ b/tools/incident_section_gen/main.cpp
@@ -413,7 +413,8 @@ static bool generateSectionListCpp(Descriptor const* descriptor) {
case SECTION_NONE:
continue;
case SECTION_FILE:
- printf(" new FileSection(%d, \"%s\"),\n", field->number(), s.args().c_str());
+ printf(" new FileSection(%d, \"%s\", %s),\n", field->number(), s.args().c_str(),
+ s.device_specific() ? "true" : "false");
break;
case SECTION_COMMAND:
printf(" new CommandSection(%d,", field->number());