diff options
author | Abhijeet Kaur <abkaur@google.com> | 2019-04-17 16:00:09 +0100 |
---|---|---|
committer | Abhijeet Kaur <abkaur@google.com> | 2019-04-17 15:46:15 +0000 |
commit | 5762741b9fae99c2fd90fad0fbb708ee64a9c209 (patch) | |
tree | cfdef79911dfa145ef0339aa57efe9e4dd774abb | |
parent | 0a75a6ae0e662034bc39934df4d9721b534a7db0 (diff) | |
download | native-5762741b9fae99c2fd90fad0fbb708ee64a9c209.tar.gz |
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
Change-Id: Idd8cd2a62977ad592db9caf3febe89dd9917203f
-rw-r--r-- | cmds/dumpstate/dumpstate.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/cmds/dumpstate/dumpstate.cpp b/cmds/dumpstate/dumpstate.cpp index bce2edb6f8..3f5bd7ed00 100644 --- a/cmds/dumpstate/dumpstate.cpp +++ b/cmds/dumpstate/dumpstate.cpp @@ -2691,7 +2691,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"); + } } } |