Add more arguments to Dumpstate binder interface
Add output file descriptors and listener to startBugreport.
Bug: 111441001
Test: builds
Change-Id: If42deb3ddc944fc3756025dba49da249dd959212
diff --git a/cmds/dumpstate/DumpstateService.cpp b/cmds/dumpstate/DumpstateService.cpp
index 849eb44..909bdd7 100644
--- a/cmds/dumpstate/DumpstateService.cpp
+++ b/cmds/dumpstate/DumpstateService.cpp
@@ -98,9 +98,11 @@
return binder::Status::ok();
}
-binder::Status DumpstateService::startBugreport(int, int bugreport_mode, int32_t* returned_id) {
- // TODO(111441001): return a request id here.
- *returned_id = -1;
+binder::Status DumpstateService::startBugreport(const android::base::unique_fd& /* bugreportFd */,
+ const android::base::unique_fd& /* screenshotFd */,
+ int bugreport_mode,
+ const sp<IDumpstateListener>& /* listener */) {
+ // TODO(b/111441001): Pass in fds & other arguments to DumpOptions.
MYLOGI("startBugreport() with mode: %d\n", bugreport_mode);
if (bugreport_mode != Dumpstate::BugreportMode::BUGREPORT_FULL &&
diff --git a/cmds/dumpstate/DumpstateService.h b/cmds/dumpstate/DumpstateService.h
index 58095b3..1736ae8 100644
--- a/cmds/dumpstate/DumpstateService.h
+++ b/cmds/dumpstate/DumpstateService.h
@@ -20,6 +20,7 @@
#include <mutex>
#include <vector>
+#include <android-base/unique_fd.h>
#include <binder/BinderService.h>
#include "android/os/BnDumpstate.h"
@@ -41,7 +42,9 @@
bool getSectionDetails,
sp<IDumpstateToken>* returned_token) override;
- binder::Status startBugreport(int fd, int bugreport_mode, int32_t* returned_id) override;
+ binder::Status startBugreport(const android::base::unique_fd& bugreportFd,
+ const android::base::unique_fd& screenshotFd, int bugreport_mode,
+ const sp<IDumpstateListener>& listener) override;
private:
Dumpstate& ds_;
diff --git a/cmds/dumpstate/binder/android/os/IDumpstate.aidl b/cmds/dumpstate/binder/android/os/IDumpstate.aidl
index 617eab3..ba3e290 100644
--- a/cmds/dumpstate/binder/android/os/IDumpstate.aidl
+++ b/cmds/dumpstate/binder/android/os/IDumpstate.aidl
@@ -63,6 +63,12 @@
/*
* Starts a bugreport in the background.
+ *
+ * @param bugreportFd the file to which the zipped bugreport should be written
+ * @param screenshotFd the file to which screenshot should be written; optional
+ * @param bugreportMode the mode that specifies other run time options; must be one of above
+ * @param listener callback for updates; optional
*/
- int startBugreport(int fd, int bugreportMode);
+ void startBugreport(FileDescriptor bugreportFd, FileDescriptor screenshotFd, int bugreportMode,
+ IDumpstateListener listener);
}