Added initial tests for dumpstate.
BUG: 31807540
Test: mmm -j32 frameworks/native/cmds/dumpstate/ && adb push ${ANDROID_PRODUCT_OUT}/data/nativetest/dumpstate_test* /data/nativetest && adb shell /data/nativetest/dumpstate_test/dumpstate_test
Change-Id: If5497784052b8d13d7c856f9400dbcd8c2015d05
diff --git a/cmds/dumpstate/dumpstate.h b/cmds/dumpstate/dumpstate.h
index 70af270..1c570b0 100644
--- a/cmds/dumpstate/dumpstate.h
+++ b/cmds/dumpstate/dumpstate.h
@@ -202,6 +202,8 @@
* that are spread accross utils.cpp and dumpstate.cpp will be moved to it.
*/
class Dumpstate {
+ friend class DumpstateTest;
+
public:
static Dumpstate& GetInstance();
@@ -274,15 +276,18 @@
// When set, defines a socket file-descriptor use to report progress to bugreportz.
int controlSocketFd_ = -1;
- // Whether this is a dry run.
- bool dryRun_;
+ // Build type (such as 'user' or 'eng').
+ std::string buildType_;
// Full path of the directory where the bugreport files will be written;
std::string bugreportDir_;
private:
+ // Whether this is a dry run.
+ bool dryRun_;
+
// Used by GetInstance() only.
- Dumpstate();
+ Dumpstate(bool dryRun = false);
};
// for_each_pid_func = void (*)(int, const char*);