From e4d4fbc8c0257a79d9c6091cea2c264415bd2733 Mon Sep 17 00:00:00 2001 From: Dianne Hackborn Date: Tue, 8 Nov 2011 11:53:28 -0800 Subject: Add drop box reports of low memory. We are tagging these as "watchdog" to make them visible in the reporting tools. Also new am command to kill all background processes, mostly to make it easier to test this stuff. Change-Id: Ib9dc4747cd8bd44156fdf11d6a087cd4272203eb --- cmds/am/src/com/android/commands/am/Am.java | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'cmds') diff --git a/cmds/am/src/com/android/commands/am/Am.java b/cmds/am/src/com/android/commands/am/Am.java index 4f72289..7c03a2f 100644 --- a/cmds/am/src/com/android/commands/am/Am.java +++ b/cmds/am/src/com/android/commands/am/Am.java @@ -109,6 +109,10 @@ public class Am { runStartService(); } else if (op.equals("force-stop")) { runForceStop(); + } else if (op.equals("kill")) { + runKill(); + } else if (op.equals("kill-all")) { + runKillAll(); } else if (op.equals("instrument")) { runInstrument(); } else if (op.equals("broadcast")) { @@ -484,6 +488,14 @@ public class Am { mAm.forceStopPackage(nextArgRequired()); } + private void runKill() throws Exception { + mAm.killBackgroundProcesses(nextArgRequired()); + } + + private void runKillAll() throws Exception { + mAm.killAllBackgroundProcesses(); + } + private void sendBroadcast() throws Exception { Intent intent = makeIntent(); IntentReceiver receiver = new IntentReceiver(); @@ -1179,6 +1191,8 @@ public class Am { " [--R COUNT] [-S] \n" + " am startservice \n" + " am force-stop \n" + + " am kill \n" + + " am kill-all\n" + " am broadcast \n" + " am instrument [-r] [-e ] [-p ] [-w]\n" + " [--no-window-animation] \n" + @@ -1202,6 +1216,12 @@ public class Am { "\n" + "am force-stop: force stop everything associated with .\n" + "\n" + + "am kill: Kill all processes associated with . Only kills.\n" + + " processes that are safe to kill -- that is, will not impact the user\n" + + " experience.\n" + + "\n" + + "am kill-all: Kill all background processes.\n" + + "\n" + "am broadcast: send a broadcast Intent.\n" + "\n" + "am instrument: start an Instrumentation. Typically this target \n" + -- cgit v1.1