Take screenshot right away when invoked with -P.
Traditionally, the screenshot was not taken right away because it could
skew other services like the Surface Flinger, and such approach often
resulted on irrelevant screenshots.
Now there is more user-friendly workflow, where the bugreport progress
is shown in the UI and the user can take further actions. In this
workflow, it's ok to take the screeshot right away, since the other
features might already be causing interference: if the user doesn't want
interference, the old workflow should be used instead.
Since the new workflow requires the -P (for Progress) parameter, such
parameter can also be used to determine when to take the screenshot.
Also added progress statistics at the end of the bugreport.
BUG: 8420215
Change-Id: I9dad8ea59d47848f217182ccec0f527b42e07f50
diff --git a/cmds/dumpstate/dumpstate.h b/cmds/dumpstate/dumpstate.h
index c7e7f52..26e16d0 100644
--- a/cmds/dumpstate/dumpstate.h
+++ b/cmds/dumpstate/dumpstate.h
@@ -69,7 +69,7 @@
* It would be better to take advantage of the C++ migration and encapsulate the state in an object,
* but that will be better handled in a major C++ refactoring, which would also get rid of other C
* idioms (like using std::string instead of char*, removing varargs, etc...) */
-extern int do_update_progress;
+extern int do_update_progress, progress, weight_total;
/* prints the contents of a file */
int dump_file(const char *title, const char *path);
@@ -139,6 +139,9 @@
/* Implemented by libdumpstate_board to dump board-specific info */
void dumpstate_board();
+/* Takes a screenshot and save it to the given file */
+void take_screenshot(std::string path);
+
#ifdef __cplusplus
}
#endif