Created a dumpstate service.
For now this is still a limited service:
- It's only created when running an interactive bugreport.
- It only provides a listener to get updates.
- It will be just used by Shell to get updates.
Test: dumpstate_test passes
BUG: 31636879
Change-Id: Iae820261d220523c979bf905030456fcf0b2b618
diff --git a/cmds/dumpstate/dumpstate.h b/cmds/dumpstate/dumpstate.h
index 950f185..0680db2 100644
--- a/cmds/dumpstate/dumpstate.h
+++ b/cmds/dumpstate/dumpstate.h
@@ -40,6 +40,8 @@
#include <android-base/macros.h>
#include <ziparchive/zip_writer.h>
+#include "android/os/BnDumpstate.h"
+
// Workaround for const char *args[MAX_ARGS_ARRAY_SIZE] variables until they're converted to
// std::vector<std::string>
// TODO: remove once not used
@@ -332,6 +334,9 @@
// dumpstate id - unique after each device reboot.
unsigned long id_;
+ // dumpstate pid
+ pid_t pid_;
+
// Whether progress updates should be published.
bool update_progress_ = false;
@@ -387,6 +392,10 @@
// Pointer to the zip structure.
std::unique_ptr<ZipWriter> zip_writer_;
+ // Binder object listing to progress.
+ android::sp<android::os::IDumpstateListener> listener_;
+ std::string listener_name_;
+
private:
// Used by GetInstance() only.
Dumpstate(const std::string& version = VERSION_CURRENT, bool dry_run = false,