Separate options parsing from running dumpstate
This refactor allows accepting options in other ways, for eg
via binder calls.
BUG: 111441001
Test: adb shell /data/nativetest64/dumpstate_test/dumpstate_test
Test: adb bugreport
Test: interactive bugreport
Change-Id: Id27c917a3b51e1b9c0485ef3ff473b3cf22243df
diff --git a/cmds/dumpstate/DumpstateService.cpp b/cmds/dumpstate/DumpstateService.cpp
index 260ea4b..71658d8 100644
--- a/cmds/dumpstate/DumpstateService.cpp
+++ b/cmds/dumpstate/DumpstateService.cpp
@@ -87,27 +87,27 @@
status_t DumpstateService::dump(int fd, const Vector<String16>&) {
dprintf(fd, "id: %d\n", ds_.id_);
dprintf(fd, "pid: %d\n", ds_.pid_);
- dprintf(fd, "update_progress: %s\n", ds_.update_progress_ ? "true" : "false");
+ dprintf(fd, "update_progress: %s\n", ds_.options_->do_progress_updates ? "true" : "false");
dprintf(fd, "update_progress_threshold: %d\n", ds_.update_progress_threshold_);
dprintf(fd, "last_updated_progress: %d\n", ds_.last_updated_progress_);
dprintf(fd, "progress:\n");
ds_.progress_->Dump(fd, " ");
- dprintf(fd, "args: %s\n", ds_.args_.c_str());
- dprintf(fd, "extra_options: %s\n", ds_.extra_options_.c_str());
+ dprintf(fd, "args: %s\n", ds_.options_->args.c_str());
+ dprintf(fd, "extra_options: %s\n", ds_.options_->extra_options.c_str());
dprintf(fd, "version: %s\n", ds_.version_.c_str());
dprintf(fd, "bugreport_dir: %s\n", ds_.bugreport_dir_.c_str());
dprintf(fd, "screenshot_path: %s\n", ds_.screenshot_path_.c_str());
dprintf(fd, "log_path: %s\n", ds_.log_path_.c_str());
dprintf(fd, "tmp_path: %s\n", ds_.tmp_path_.c_str());
dprintf(fd, "path: %s\n", ds_.path_.c_str());
- dprintf(fd, "extra_options: %s\n", ds_.extra_options_.c_str());
+ dprintf(fd, "extra_options: %s\n", ds_.options_->extra_options.c_str());
dprintf(fd, "base_name: %s\n", ds_.base_name_.c_str());
dprintf(fd, "name: %s\n", ds_.name_.c_str());
dprintf(fd, "now: %ld\n", ds_.now_);
dprintf(fd, "is_zipping: %s\n", ds_.IsZipping() ? "true" : "false");
dprintf(fd, "listener: %s\n", ds_.listener_name_.c_str());
- dprintf(fd, "notification title: %s\n", ds_.notification_title.c_str());
- dprintf(fd, "notification description: %s\n", ds_.notification_description.c_str());
+ dprintf(fd, "notification title: %s\n", ds_.options_->notification_title.c_str());
+ dprintf(fd, "notification description: %s\n", ds_.options_->notification_description.c_str());
return NO_ERROR;
}