summaryrefslogtreecommitdiff
path: root/cmds/dumpstate/utils.cpp
diff options
context:
space:
mode:
author Nandana Dutt <nandana@google.com> 2019-03-15 02:22:50 -0700
committer android-build-merger <android-build-merger@google.com> 2019-03-15 02:22:50 -0700
commit97f1721bd49baa3dc39a88b74b03e6f870ad0055 (patch)
treebcbb96f5a4aa19c6fb3ea2ae802f3db0e6511e86 /cmds/dumpstate/utils.cpp
parentf8ddfdbaabe19e50119d5df9aa093d7daacab37f (diff)
parent62b3ec5981b7843d3b23f5030e4d9042731faa1b (diff)
Merge "Handle user consent denial sooner"
am: 62b3ec5981 Change-Id: I9403e618bc647742b11c4b4428e4bebef78728d9
Diffstat (limited to 'cmds/dumpstate/utils.cpp')
-rw-r--r--cmds/dumpstate/utils.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/cmds/dumpstate/utils.cpp b/cmds/dumpstate/utils.cpp
index 4efa99b59b..0bb80dcfba 100644
--- a/cmds/dumpstate/utils.cpp
+++ b/cmds/dumpstate/utils.cpp
@@ -280,6 +280,12 @@ static void __for_each_pid(void (*helper)(int, const char *, void *), const char
if (header) printf("\n------ %s ------\n", header);
while ((de = readdir(d))) {
+ if (ds.IsUserConsentDenied()) {
+ MYLOGE(
+ "Returning early because user denied consent to share bugreport with calling app.");
+ closedir(d);
+ return;
+ }
int pid;
int fd;
char cmdpath[255];
@@ -352,6 +358,12 @@ static void for_each_tid_helper(int pid, const char *cmdline, void *arg) {
func(pid, pid, cmdline);
while ((de = readdir(d))) {
+ if (ds.IsUserConsentDenied()) {
+ MYLOGE(
+ "Returning early because user denied consent to share bugreport with calling app.");
+ closedir(d);
+ return;
+ }
int tid;
int fd;
char commpath[255];