Make dumpstate bugreport names as tmp if called by API
Since we are migrating away from dumpstate being directly triggered,
only API will be calling dumpstate. API would pass final bugreport file
fds to dumpstate, that implies dumpstate bugreport files are
getting copied over. Marking these files with a suffix of -tmp as:
* These (bugreport .zip and screenshot .png) files are eventually
getting deleted.
* These (bugreport .zip and screenshot .png) file names can be used
by API callers (as the final bugreport names) for consistency.
Since the files are in the same dir, need to add suffix to differentiate.
Bug: 126862297
Test: * Build and flash to the device
* Turn on Settings feature flag to use the bugreport API
* Take interactive and full bugreports
* run `adb shell ls /bugreports` while bugreports are being
generated and after the bugreport is captured
* Can see tmp files when the bugreport is in progress
* Output file names same as before
Change-Id: Ia88e373a373d573d9c1e089924290b9526a3d2e1
diff --git a/cmds/dumpstate/dumpstate.h b/cmds/dumpstate/dumpstate.h
index ae6a721..fe330df 100644
--- a/cmds/dumpstate/dumpstate.h
+++ b/cmds/dumpstate/dumpstate.h
@@ -341,6 +341,11 @@
bool IsUserConsentDenied() const;
/*
+ * Returns true if dumpstate is called by bugreporting API
+ */
+ bool CalledByApi() const;
+
+ /*
* Structure to hold options that determine the behavior of dumpstate.
*/
struct DumpOptions {