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

Commit 400e8d34 authored by Nandana Dutt's avatar Nandana Dutt Committed by android-build-merger
Browse files

Merge "Dumpstate aidl: add cancelBugreport" am: 75c59f8b am: adcb7276

am: bff2096b

Change-Id: Ic935e9395b82ceab9509b17682910f02b0dc439d
parents 46a41091 bff2096b
Loading
Loading
Loading
Loading
+9 −4
Original line number Diff line number Diff line
@@ -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;
}

@@ -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 &&
@@ -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())
+3 −0
Original line number Diff line number Diff line
@@ -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_;
+5 −0
Original line number Diff line number Diff line
@@ -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();
}
+2 −7
Original line number Diff line number Diff line
@@ -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);
+1 −3
Original line number Diff line number Diff line
@@ -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