Loading cmds/dumpstate/dumpstate.cpp +10 −3 Original line number Original line Diff line number Diff line Loading @@ -2475,6 +2475,13 @@ Dumpstate::RunStatus Dumpstate::RunInternal(int32_t calling_uid, // bugreport is not shared but made available for manual retrieval. // bugreport is not shared but made available for manual retrieval. return status; return status; } } if (options_->screenshot_fd.get() != -1) { bool copy_succeeded = android::os::CopyFileToFd(screenshot_path_, options_->screenshot_fd.get()); if (copy_succeeded) { android::os::UnlinkAndLogOnError(screenshot_path_); } } } } /* vibrate a few but shortly times to let user know it's finished */ /* vibrate a few but shortly times to let user know it's finished */ Loading Loading @@ -2560,9 +2567,9 @@ Dumpstate::RunStatus Dumpstate::CopyBugreportIfUserConsented() { return HandleUserConsentDenied(); return HandleUserConsentDenied(); } } if (consent_result == UserConsentResult::APPROVED) { if (consent_result == UserConsentResult::APPROVED) { bool copy_succeeded = android::os::CopyFileToFd(ds.path_, ds.options_->bugreport_fd.get()); bool copy_succeeded = android::os::CopyFileToFd(path_, options_->bugreport_fd.get()); if (copy_succeeded && remove(ds.path_.c_str())) { if (copy_succeeded) { MYLOGE("remove(%s): %s", ds.path_.c_str(), strerror(errno)); android::os::UnlinkAndLogOnError(path_); } } return copy_succeeded ? Dumpstate::RunStatus::OK : Dumpstate::RunStatus::ERROR; return copy_succeeded ? Dumpstate::RunStatus::OK : Dumpstate::RunStatus::ERROR; } else if (consent_result == UserConsentResult::UNAVAILABLE) { } else if (consent_result == UserConsentResult::UNAVAILABLE) { Loading cmds/dumpstate/dumpstate.h +0 −1 Original line number Original line Diff line number Diff line Loading @@ -347,7 +347,6 @@ class Dumpstate { // File descriptor to output zip file. // File descriptor to output zip file. android::base::unique_fd bugreport_fd; android::base::unique_fd bugreport_fd; // File descriptor to screenshot file. // File descriptor to screenshot file. // TODO(b/111441001): Use this fd. android::base::unique_fd screenshot_fd; android::base::unique_fd screenshot_fd; // TODO: rename to MODE. // TODO: rename to MODE. // Extra options passed as system property. // Extra options passed as system property. Loading Loading
cmds/dumpstate/dumpstate.cpp +10 −3 Original line number Original line Diff line number Diff line Loading @@ -2475,6 +2475,13 @@ Dumpstate::RunStatus Dumpstate::RunInternal(int32_t calling_uid, // bugreport is not shared but made available for manual retrieval. // bugreport is not shared but made available for manual retrieval. return status; return status; } } if (options_->screenshot_fd.get() != -1) { bool copy_succeeded = android::os::CopyFileToFd(screenshot_path_, options_->screenshot_fd.get()); if (copy_succeeded) { android::os::UnlinkAndLogOnError(screenshot_path_); } } } } /* vibrate a few but shortly times to let user know it's finished */ /* vibrate a few but shortly times to let user know it's finished */ Loading Loading @@ -2560,9 +2567,9 @@ Dumpstate::RunStatus Dumpstate::CopyBugreportIfUserConsented() { return HandleUserConsentDenied(); return HandleUserConsentDenied(); } } if (consent_result == UserConsentResult::APPROVED) { if (consent_result == UserConsentResult::APPROVED) { bool copy_succeeded = android::os::CopyFileToFd(ds.path_, ds.options_->bugreport_fd.get()); bool copy_succeeded = android::os::CopyFileToFd(path_, options_->bugreport_fd.get()); if (copy_succeeded && remove(ds.path_.c_str())) { if (copy_succeeded) { MYLOGE("remove(%s): %s", ds.path_.c_str(), strerror(errno)); android::os::UnlinkAndLogOnError(path_); } } return copy_succeeded ? Dumpstate::RunStatus::OK : Dumpstate::RunStatus::ERROR; return copy_succeeded ? Dumpstate::RunStatus::OK : Dumpstate::RunStatus::ERROR; } else if (consent_result == UserConsentResult::UNAVAILABLE) { } else if (consent_result == UserConsentResult::UNAVAILABLE) { Loading
cmds/dumpstate/dumpstate.h +0 −1 Original line number Original line Diff line number Diff line Loading @@ -347,7 +347,6 @@ class Dumpstate { // File descriptor to output zip file. // File descriptor to output zip file. android::base::unique_fd bugreport_fd; android::base::unique_fd bugreport_fd; // File descriptor to screenshot file. // File descriptor to screenshot file. // TODO(b/111441001): Use this fd. android::base::unique_fd screenshot_fd; android::base::unique_fd screenshot_fd; // TODO: rename to MODE. // TODO: rename to MODE. // Extra options passed as system property. // Extra options passed as system property. Loading