summaryrefslogtreecommitdiff
path: root/cmds/dumpstate/utils.cpp
diff options
context:
space:
mode:
author Nandana Dutt <nandana@google.com> 2019-03-15 09:04:16 +0000
committer Gerrit Code Review <noreply-gerritcodereview@google.com> 2019-03-15 09:04:16 +0000
commit62b3ec5981b7843d3b23f5030e4d9042731faa1b (patch)
tree3797848394c8fca319c23130746640a8d397d8b9 /cmds/dumpstate/utils.cpp
parent0472824d3edc6aee700b1eb9603f271bab62b50d (diff)
parentbbdb5b459579b53edcd2667d9dfdf45fcdbecf18 (diff)
Merge "Handle user consent denial sooner"
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];