summaryrefslogtreecommitdiffstats
path: root/cmds/am
diff options
context:
space:
mode:
authorDianne Hackborn <hackbod@google.com>2011-11-15 11:29:38 -0800
committerDianne Hackborn <hackbod@google.com>2011-11-15 14:15:58 -0800
commitd8c98fee02b5498270344727d1289004d98c0e73 (patch)
tree87512279361711cb33abd2d465be2661076a2a75 /cmds/am
parentb90a70d1542edd5a95e73b75192e6eb5a66401cc (diff)
downloadframeworks_base-d8c98fee02b5498270344727d1289004d98c0e73.zip
frameworks_base-d8c98fee02b5498270344727d1289004d98c0e73.tar.gz
frameworks_base-d8c98fee02b5498270344727d1289004d98c0e73.tar.bz2
Improve low memory dropbox reporting.
The msg is now constructed to try to bin these reports in interesting ways. We'll see. Also change the tag name from watchdog to lowmem, since sharkey is kindly taking care of the back-end to handle this. Improve how we put processes into low memory states to better poke things like home and the previous app. Also clean up some debug output, and add a few new am comment options for controlling the current debug app. Change-Id: I562a931a95244a2727bb7a6e1fd80dec259cdae2
Diffstat (limited to 'cmds/am')
-rw-r--r--cmds/am/src/com/android/commands/am/Am.java37
1 files changed, 37 insertions, 0 deletions
diff --git a/cmds/am/src/com/android/commands/am/Am.java b/cmds/am/src/com/android/commands/am/Am.java
index 7c03a2f..140222e 100644
--- a/cmds/am/src/com/android/commands/am/Am.java
+++ b/cmds/am/src/com/android/commands/am/Am.java
@@ -121,6 +121,10 @@ public class Am {
runProfile();
} else if (op.equals("dumpheap")) {
runDumpHeap();
+ } else if (op.equals("set-debug-app")) {
+ runSetDebugApp();
+ } else if (op.equals("clear-debug-app")) {
+ runClearDebugApp();
} else if (op.equals("monitor")) {
runMonitor();
} else if (op.equals("screen-compat")) {
@@ -666,6 +670,31 @@ public class Am {
}
}
+ private void runSetDebugApp() throws Exception {
+ boolean wait = false;
+ boolean persistent = false;
+
+ String opt;
+ while ((opt=nextOption()) != null) {
+ if (opt.equals("-w")) {
+ wait = true;
+ } else if (opt.equals("--persistent")) {
+ persistent = true;
+ } else {
+ System.err.println("Error: Unknown option: " + opt);
+ showUsage();
+ return;
+ }
+ }
+
+ String pkg = nextArgRequired();
+ mAm.setDebugApp(pkg, wait, persistent);
+ }
+
+ private void runClearDebugApp() throws Exception {
+ mAm.setDebugApp(null, false, true);
+ }
+
class MyActivityController extends IActivityController.Stub {
final String mGdbPort;
@@ -1199,6 +1228,8 @@ public class Am {
" am profile [looper] start <PROCESS> <FILE>\n" +
" am profile [looper] stop [<PROCESS>]\n" +
" am dumpheap [flags] <PROCESS> <FILE>\n" +
+ " am set-debug-app [-w] [--persistent] <PACKAGE>\n" +
+ " am clear-debug-app\n" +
" am monitor [--gdb <port>]\n" +
" am screen-compat [on|off] <PACKAGE>\n" +
" am display-size [reset|MxN]\n" +
@@ -1240,6 +1271,12 @@ public class Am {
"am dumpheap: dump the heap of a process. Options are:\n" +
" -n: dump native heap instead of managed heap\n" +
"\n" +
+ "am set-debug-app: set application <PACKAGE> to debug. Options are:\n" +
+ " -w: wait for debugger when application starts\n" +
+ " --persistent: retain this value\n" +
+ "\n" +
+ "am clear-debug-app: clear the previously set-debug-app.\n" +
+ "\n" +
"am monitor: start monitoring for crashes or ANRs.\n" +
" --gdb: start gdbserv on the given port at crash/ANR\n" +
"\n" +