Dumpstate aidl: add cancelBugreport
This allows adding a cancel method to the bugreporting API. Note that it
is implemented on the java side.
Also removed unused args from onFinished.
BUG: 111441001
Test: adb shell /data/nativetest64/dumpstate_test/dumpstate_test
Change-Id: I6a3a0d652c89dc157de4a4056ccddc40e5d6e549
diff --git a/cmds/dumpstate/DumpstateService.cpp b/cmds/dumpstate/DumpstateService.cpp
index 1d5b738..d24ed9c 100644
--- a/cmds/dumpstate/DumpstateService.cpp
+++ b/cmds/dumpstate/DumpstateService.cpp
@@ -44,7 +44,7 @@
static void* callAndNotify(void* data) {
Dumpstate& ds = *static_cast<Dumpstate*>(data);
ds.Run();
- MYLOGE("Finished Run()\n");
+ MYLOGD("Finished Run()\n");
return nullptr;
}
@@ -104,9 +104,6 @@
const android::base::unique_fd& screenshot_fd,
int bugreport_mode,
const sp<IDumpstateListener>& listener) {
- // TODO(b/111441001):
- // 1. check DUMP permission (again)?
- // 2. check if primary user? If non primary user the consent service will reject anyway.
MYLOGI("startBugreport() with mode: %d\n", bugreport_mode);
if (bugreport_mode != Dumpstate::BugreportMode::BUGREPORT_FULL &&
@@ -143,6 +140,14 @@
return binder::Status::ok();
}
+binder::Status DumpstateService::cancelBugreport() {
+ // This is a no-op since the cancellation is done from java side via setting sys properties.
+ // See BugreportManagerServiceImpl.
+ // TODO(b/111441001): maybe make native and java sides use different binder interface
+ // to avoid these annoyances.
+ return binder::Status::ok();
+}
+
status_t DumpstateService::dump(int fd, const Vector<String16>&) {
dprintf(fd, "id: %d\n", ds_.id_);
dprintf(fd, "pid: %d\n", ds_.pid_);