incidentd sections for userdebug and eng are compiled out
Previously, the decision to include or not include them was
done at runtime. This changes them to be behind a compile
time flag. It's just safer, because the code just isn't there
instead of being dependent on a system property.
Test: bit GtsIncidentManagerTestCases:*
Bug: 123543706
Change-Id: If4e611914a7b0acd399ae27e55af8f718aee3ec8
diff --git a/cmds/incidentd/src/Section.cpp b/cmds/incidentd/src/Section.cpp
index 1e8261e..935a7c4 100644
--- a/cmds/incidentd/src/Section.cpp
+++ b/cmds/incidentd/src/Section.cpp
@@ -25,6 +25,7 @@
#include <set>
#include <android-base/file.h>
+#include <android-base/properties.h>
#include <android-base/stringprintf.h>
#include <android/util/protobuf.h>
#include <android/util/ProtoOutputStream.h>
@@ -63,10 +64,10 @@
}
// ================================================================================
-Section::Section(int i, int64_t timeoutMs, bool userdebugAndEngOnly)
+Section::Section(int i, int64_t timeoutMs)
: id(i),
- timeoutMs(timeoutMs),
- userdebugAndEngOnly(userdebugAndEngOnly) {}
+ timeoutMs(timeoutMs) {
+}
Section::~Section() {}
@@ -74,7 +75,7 @@
static inline bool isSysfs(const char* filename) { return strncmp(filename, "/sys/", 5) == 0; }
FileSection::FileSection(int id, const char* filename, const int64_t timeoutMs)
- : Section(id, timeoutMs, false), mFilename(filename) {
+ : Section(id, timeoutMs), mFilename(filename) {
name = "file ";
name += filename;
mIsSysfs = isSysfs(filename);
@@ -236,8 +237,8 @@
WorkerThreadData::~WorkerThreadData() {}
// ================================================================================
-WorkerThreadSection::WorkerThreadSection(int id, const int64_t timeoutMs, bool userdebugAndEngOnly)
- : Section(id, timeoutMs, userdebugAndEngOnly) {}
+WorkerThreadSection::WorkerThreadSection(int id, const int64_t timeoutMs)
+ : Section(id, timeoutMs) {}
WorkerThreadSection::~WorkerThreadSection() {}
@@ -425,8 +426,8 @@
}
// ================================================================================
-DumpsysSection::DumpsysSection(int id, bool userdebugAndEngOnly, const char* service, ...)
- : WorkerThreadSection(id, REMOTE_CALL_TIMEOUT_MS, userdebugAndEngOnly), mService(service) {
+DumpsysSection::DumpsysSection(int id, const char* service, ...)
+ : WorkerThreadSection(id, REMOTE_CALL_TIMEOUT_MS), mService(service) {
name = "dumpsys ";
name += service;