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

Commit c5eff42c authored by Abhijeet Kaur's avatar Abhijeet Kaur
Browse files

Cancel outstanding user consent request

When the end of bugreport generation is reached (i.e. bugreport has been
created) but the user has not responded to the user consent dialogue,
in that case we cancel the user consent request without copying
the file over to the caller.

Test: Tested by not replying to the user consent and checking the logs.
Bug: 128982019
Merged-In: Idd8cd2a62977ad592db9caf3febe89dd9917203f
Change-Id: Idd8cd2a62977ad592db9caf3febe89dd9917203f
(cherry picked from commit 5762741b)
parent a6962908
Loading
Loading
Loading
Loading
+9 −1
Original line number Diff line number Diff line
@@ -2697,7 +2697,15 @@ Dumpstate::RunStatus Dumpstate::RunInternal(int32_t calling_uid,
            MYLOGI(
                "Did not receive user consent yet."
                " Will not copy the bugreport artifacts to caller.\n");
            // TODO(b/111441001): cancel outstanding requests
            const String16 incidentcompanion("incidentcompanion");
            sp<android::IBinder> ics(defaultServiceManager()->getService(incidentcompanion));
            if (ics != nullptr) {
                MYLOGD("Canceling user consent request via incidentcompanion service\n");
                android::interface_cast<android::os::IIncidentCompanion>(ics)->cancelAuthorization(
                        consent_callback_.get());
            } else {
                MYLOGD("Unable to cancel user consent; incidentcompanion service unavailable\n");
            }
        }
    }