Loading cmds/dumpstate/DumpstateService.cpp +9 −4 Original line number Diff line number Diff line Loading @@ -44,7 +44,7 @@ static binder::Status error(uint32_t code, const std::string& msg) { static void* callAndNotify(void* data) { Dumpstate& ds = *static_cast<Dumpstate*>(data); ds.Run(); MYLOGE("Finished Run()\n"); MYLOGD("Finished Run()\n"); return nullptr; } Loading Loading @@ -104,9 +104,6 @@ binder::Status DumpstateService::startBugreport(int32_t /* calling_uid */, 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 && Loading Loading @@ -143,6 +140,14 @@ binder::Status DumpstateService::startBugreport(int32_t /* calling_uid */, 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>&) { std::string destination = ds_.options_->bugreport_fd.get() != -1 ? StringPrintf("[fd:%d]", ds_.options_->bugreport_fd.get()) Loading cmds/dumpstate/DumpstateService.h +3 −0 Original line number Diff line number Diff line Loading @@ -47,6 +47,9 @@ class DumpstateService : public BinderService<DumpstateService>, public BnDumpst const android::base::unique_fd& screenshot_fd, int bugreport_mode, const sp<IDumpstateListener>& listener) override; // No-op binder::Status cancelBugreport(); private: Dumpstate& ds_; std::mutex lock_; Loading cmds/dumpstate/binder/android/os/IDumpstate.aidl +5 −0 Original line number Diff line number Diff line Loading @@ -79,4 +79,9 @@ interface IDumpstate { void startBugreport(int callingUid, @utf8InCpp String callingPackage, FileDescriptor bugreportFd, FileDescriptor screenshotFd, int bugreportMode, IDumpstateListener listener); /* * Cancels the bugreport currently in progress. */ void cancelBugreport(); } cmds/dumpstate/binder/android/os/IDumpstateListener.aidl +2 −7 Original line number Diff line number Diff line Loading @@ -44,14 +44,9 @@ interface IDumpstateListener { oneway void onError(int errorCode); /** * Called when taking bugreport finishes successfully * * @param durationMs time capturing bugreport took in milliseconds * @param title title for the bugreport; helpful in reminding the user why they took it * @param description detailed description for the bugreport * Called when taking bugreport finishes successfully. */ oneway void onFinished(long durationMs, @utf8InCpp String title, @utf8InCpp String description); oneway void onFinished(); // TODO(b/111441001): Remove old methods when not used anymore. void onProgressUpdated(int progress); Loading cmds/dumpstate/dumpstate.cpp +1 −3 Original line number Diff line number Diff line Loading @@ -2197,9 +2197,7 @@ Dumpstate::RunStatus Dumpstate::Run() { if (listener_ != nullptr) { switch (status) { case Dumpstate::RunStatus::OK: // TODO(b/111441001): duration argument does not make sense. Remove. listener_->onFinished(0 /* duration */, options_->notification_title, options_->notification_description); listener_->onFinished(); break; case Dumpstate::RunStatus::HELP: break; Loading Loading
cmds/dumpstate/DumpstateService.cpp +9 −4 Original line number Diff line number Diff line Loading @@ -44,7 +44,7 @@ static binder::Status error(uint32_t code, const std::string& msg) { static void* callAndNotify(void* data) { Dumpstate& ds = *static_cast<Dumpstate*>(data); ds.Run(); MYLOGE("Finished Run()\n"); MYLOGD("Finished Run()\n"); return nullptr; } Loading Loading @@ -104,9 +104,6 @@ binder::Status DumpstateService::startBugreport(int32_t /* calling_uid */, 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 && Loading Loading @@ -143,6 +140,14 @@ binder::Status DumpstateService::startBugreport(int32_t /* calling_uid */, 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>&) { std::string destination = ds_.options_->bugreport_fd.get() != -1 ? StringPrintf("[fd:%d]", ds_.options_->bugreport_fd.get()) Loading
cmds/dumpstate/DumpstateService.h +3 −0 Original line number Diff line number Diff line Loading @@ -47,6 +47,9 @@ class DumpstateService : public BinderService<DumpstateService>, public BnDumpst const android::base::unique_fd& screenshot_fd, int bugreport_mode, const sp<IDumpstateListener>& listener) override; // No-op binder::Status cancelBugreport(); private: Dumpstate& ds_; std::mutex lock_; Loading
cmds/dumpstate/binder/android/os/IDumpstate.aidl +5 −0 Original line number Diff line number Diff line Loading @@ -79,4 +79,9 @@ interface IDumpstate { void startBugreport(int callingUid, @utf8InCpp String callingPackage, FileDescriptor bugreportFd, FileDescriptor screenshotFd, int bugreportMode, IDumpstateListener listener); /* * Cancels the bugreport currently in progress. */ void cancelBugreport(); }
cmds/dumpstate/binder/android/os/IDumpstateListener.aidl +2 −7 Original line number Diff line number Diff line Loading @@ -44,14 +44,9 @@ interface IDumpstateListener { oneway void onError(int errorCode); /** * Called when taking bugreport finishes successfully * * @param durationMs time capturing bugreport took in milliseconds * @param title title for the bugreport; helpful in reminding the user why they took it * @param description detailed description for the bugreport * Called when taking bugreport finishes successfully. */ oneway void onFinished(long durationMs, @utf8InCpp String title, @utf8InCpp String description); oneway void onFinished(); // TODO(b/111441001): Remove old methods when not used anymore. void onProgressUpdated(int progress); Loading
cmds/dumpstate/dumpstate.cpp +1 −3 Original line number Diff line number Diff line Loading @@ -2197,9 +2197,7 @@ Dumpstate::RunStatus Dumpstate::Run() { if (listener_ != nullptr) { switch (status) { case Dumpstate::RunStatus::OK: // TODO(b/111441001): duration argument does not make sense. Remove. listener_->onFinished(0 /* duration */, options_->notification_title, options_->notification_description); listener_->onFinished(); break; case Dumpstate::RunStatus::HELP: break; Loading