Implement a new type of section which reads from logd and dumps proto.

And implement a file section which reads from event-log-tags for
decoding binary logs.

Bug: 70936599
Test: atest incidentd_test && atest incident_helper_test and flush on
device and test log sections and event_log_tag_map
Change-Id: Ib3d35e317f355de69f01ded012482486e9a43da6
diff --git a/cmds/incidentd/src/Section.h b/cmds/incidentd/src/Section.h
index 64558a6..d440ee9 100644
--- a/cmds/incidentd/src/Section.h
+++ b/cmds/incidentd/src/Section.h
@@ -19,7 +19,9 @@
 
 #include "Reporter.h"
 
+#include <map>
 #include <stdarg.h>
+
 #include <utils/String8.h>
 #include <utils/String16.h>
 #include <utils/Vector.h>
@@ -122,5 +124,24 @@
     Vector<String16> mArgs;
 };
 
+/**
+ * Section that reads from logd.
+ */
+class LogSection : public WorkerThreadSection
+{
+    // global last log retrieved timestamp for each log_id_t.
+    static map<log_id_t, log_time> gLastLogsRetrieved;
+
+public:
+    LogSection(int id, log_id_t logID);
+    virtual ~LogSection();
+
+    virtual status_t BlockingCall(int pipeWriteFd) const;
+
+private:
+    log_id_t mLogID;
+    bool mBinary;
+};
+
 #endif // SECTIONS_H