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.h b/cmds/incidentd/src/Section.h
index f89824c..cfe7e16 100644
--- a/cmds/incidentd/src/Section.h
+++ b/cmds/incidentd/src/Section.h
@@ -40,10 +40,9 @@
public:
const int id;
const int64_t timeoutMs; // each section must have a timeout
- const bool userdebugAndEngOnly;
String8 name;
- Section(int id, int64_t timeoutMs = REMOTE_CALL_TIMEOUT_MS, bool userdebugAndEngOnly = false);
+ Section(int id, int64_t timeoutMs = REMOTE_CALL_TIMEOUT_MS);
virtual ~Section();
virtual status_t Execute(ReportWriter* writer) const = 0;
@@ -85,8 +84,7 @@
*/
class WorkerThreadSection : public Section {
public:
- WorkerThreadSection(int id, int64_t timeoutMs = REMOTE_CALL_TIMEOUT_MS,
- bool userdebugAndEngOnly = false);
+ WorkerThreadSection(int id, int64_t timeoutMs = REMOTE_CALL_TIMEOUT_MS);
virtual ~WorkerThreadSection();
virtual status_t Execute(ReportWriter* writer) const;
@@ -116,7 +114,7 @@
*/
class DumpsysSection : public WorkerThreadSection {
public:
- DumpsysSection(int id, bool userdebugAndEngOnly, const char* service, ...);
+ DumpsysSection(int id, const char* service, ...);
virtual ~DumpsysSection();
virtual status_t BlockingCall(int pipeWriteFd) const;
@@ -127,6 +125,21 @@
};
/**
+ * Section that calls dumpsys on a system service.
+ */
+class SystemPropertyDumpsysSection : public WorkerThreadSection {
+public:
+ SystemPropertyDumpsysSection(int id, const char* service, ...);
+ virtual ~SystemPropertyDumpsysSection();
+
+ virtual status_t BlockingCall(int pipeWriteFd) const;
+
+private:
+ String16 mService;
+ Vector<String16> mArgs;
+};
+
+/**
* Section that reads from logd.
*/
class LogSection : public WorkerThreadSection {