Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ebff2314 authored by Abhijeet Kaur's avatar Abhijeet Kaur Committed by Automerger Merge Worker
Browse files

Merge "Copy Screenshot to fd if and only if user consent approved" into...

Merge "Copy Screenshot to fd if and only if user consent approved" into rvc-dev am: 5653ee25 am: 8db3369c am: 6799abb7 am: 9700ecd9

Change-Id: Iabde86da80a12d1c88d67a996a2a1d12a1bc7800
parents 4fa9198b 9700ecd9
Loading
Loading
Loading
Loading
+10 −9
Original line number Original line Diff line number Diff line
@@ -2677,15 +2677,6 @@ Dumpstate::RunStatus Dumpstate::RunInternal(int32_t calling_uid,
            MYLOGI("User denied consent. Returning\n");
            MYLOGI("User denied consent. Returning\n");
            return status;
            return status;
        }
        }
        if (options_->do_screenshot &&
            options_->screenshot_fd.get() != -1 &&
            !options_->is_screenshot_copied) {
            bool copy_succeeded = android::os::CopyFileToFd(screenshot_path_,
                                                            options_->screenshot_fd.get());
            if (copy_succeeded) {
                android::os::UnlinkAndLogOnError(screenshot_path_);
            }
        }
        if (status == Dumpstate::RunStatus::USER_CONSENT_TIMED_OUT) {
        if (status == Dumpstate::RunStatus::USER_CONSENT_TIMED_OUT) {
            MYLOGI(
            MYLOGI(
                "Did not receive user consent yet."
                "Did not receive user consent yet."
@@ -2815,6 +2806,16 @@ Dumpstate::RunStatus Dumpstate::CopyBugreportIfUserConsented(int32_t calling_uid
        bool copy_succeeded = android::os::CopyFileToFd(path_, options_->bugreport_fd.get());
        bool copy_succeeded = android::os::CopyFileToFd(path_, options_->bugreport_fd.get());
        if (copy_succeeded) {
        if (copy_succeeded) {
            android::os::UnlinkAndLogOnError(path_);
            android::os::UnlinkAndLogOnError(path_);
            if (options_->do_screenshot &&
                options_->screenshot_fd.get() != -1 &&
                !options_->is_screenshot_copied) {
                copy_succeeded = android::os::CopyFileToFd(screenshot_path_,
                                                           options_->screenshot_fd.get());
                options_->is_screenshot_copied = copy_succeeded;
                if (copy_succeeded) {
                    android::os::UnlinkAndLogOnError(screenshot_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) {