diff options
author | Felipe Leme <felipeal@google.com> | 2015-12-04 16:37:28 -0800 |
---|---|---|
committer | Felipe Leme <felipeal@google.com> | 2015-12-05 10:30:18 -0800 |
commit | 4cc863338d5e43b6189e05498d7cb53ebba135e1 (patch) | |
tree | d2c9b0f66667595cd21d8b212546e846756bf2b2 /cmds/am/src | |
parent | 471c1adf0867181c8f71a364606724ece7d4c56e (diff) |
Changed ActivityManager.requestBugreport() to take a 'progress' parameter.
When progress is set to 'true', it calls the new, enhanced
'bugreportplus' service, while when 'false' it calls the regular
'bugreport' service.
'bugreportplus' is more user-friendly (it shows a system notification
with the progress, allow user to cancel, etc...), at the cost of
consuming more resources. As such, the "Take Bug Report" UI will be
changed to offer the user a combo with these 2 options, but for now it's
always going to be 'bugreportplus'
BUG: 26034608
Change-Id: I21a6b5b092a85614e91d523b8f4df1fb00e49b3b
Diffstat (limited to 'cmds/am/src')
-rw-r--r-- | cmds/am/src/com/android/commands/am/Am.java | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/cmds/am/src/com/android/commands/am/Am.java b/cmds/am/src/com/android/commands/am/Am.java index 2ad63b53efc6..4f7a1095cfbe 100644 --- a/cmds/am/src/com/android/commands/am/Am.java +++ b/cmds/am/src/com/android/commands/am/Am.java @@ -142,6 +142,7 @@ public class Am extends BaseCommand { " am clear-debug-app\n" + " am set-watch-heap <PROCESS> <MEM-LIMIT>\n" + " am clear-watch-heap\n" + + " am bug-report [--progress]\n" + " am monitor [--gdb <port>]\n" + " am hang [--allow-restart]\n" + " am restart\n" + @@ -258,8 +259,9 @@ public class Am extends BaseCommand { "\n" + "am clear-watch-heap: clear the previously set-watch-heap.\n" + "\n" + - "am bug-report: request bug report generation; will launch UI\n" + - " when done to select where it should be delivered.\n" + + "am bug-report: request bug report generation; will launch a notification\n" + + " when done to select where it should be delivered. Options are: \n" + + " --progress: will launch a notification right away to show its progress.\n" + "\n" + "am monitor: start monitoring for crashes or ANRs.\n" + " --gdb: start gdbserv on the given port at crash/ANR\n" + @@ -1072,7 +1074,17 @@ public class Am extends BaseCommand { } private void runBugReport() throws Exception { - mAm.requestBugReport(); + String opt; + boolean progress = false; + while ((opt=nextOption()) != null) { + if (opt.equals("--progress")) { + progress = true; + } else { + System.err.println("Error: Unknown option: " + opt); + return; + } + } + mAm.requestBugReport(progress); System.out.println("Your lovely bug report is being created; please be patient."); } |