diff options
author | Yi Jin <jinyithu@google.com> | 2018-01-24 17:33:35 -0800 |
---|---|---|
committer | Yi Jin <jinyithu@google.com> | 2018-01-24 18:25:33 -0800 |
commit | b8344dc72fde9386cdecbb1aa8a47f1e8e430111 (patch) | |
tree | 6b28079105fb9b0ff8bd194c66e6a1eb03ac46af /tools/incident_report | |
parent | c04c265dd57e0fe2c880e529cc5cfc8164180009 (diff) |
Fix command line tool to set the right privacy enum.
Test: manual
Change-Id: I3f0845ea32b46f1a028f8b6d3d4180a90a47beb5
Diffstat (limited to 'tools/incident_report')
-rw-r--r-- | tools/incident_report/main.cpp | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/tools/incident_report/main.cpp b/tools/incident_report/main.cpp index bd1b973c7bdf..302d7395f3e4 100644 --- a/tools/incident_report/main.cpp +++ b/tools/incident_report/main.cpp @@ -452,9 +452,10 @@ main(int argc, char** argv) bool adbIncidentWorkaround = true; pid_t childPid = -1; vector<string> sections; + const char* privacy = NULL; int opt; - while ((opt = getopt(argc, argv, "bhi:o:s:tw")) != -1) { + while ((opt = getopt(argc, argv, "bhi:o:s:twp:")) != -1) { switch (opt) { case 'b': outputFormat = OUTPUT_PROTO; @@ -477,6 +478,9 @@ main(int argc, char** argv) case 'w': adbIncidentWorkaround = false; break; + case 'p': + privacy = optarg; + break; default: usage(stderr); return 1; @@ -526,7 +530,7 @@ main(int argc, char** argv) } // TODO: This is what the real implementation will be... - char const** args = (char const**)malloc(sizeof(char*) * (6 + sections.size())); + char const** args = (char const**)malloc(sizeof(char*) * (8 + sections.size())); int argpos = 0; args[argpos++] = "adb"; if (adbSerial != NULL) { @@ -535,6 +539,10 @@ main(int argc, char** argv) } args[argpos++] = "shell"; args[argpos++] = "incident"; + if (privacy != NULL) { + args[argpos++] = "-p"; + args[argpos++] = privacy; + } for (vector<string>::const_iterator it=sections.begin(); it!=sections.end(); it++) { args[argpos++] = it->c_str(); } |