summaryrefslogtreecommitdiffstats
path: root/cmds
diff options
context:
space:
mode:
Diffstat (limited to 'cmds')
-rw-r--r--cmds/am/src/com/android/commands/am/Am.java20
1 files changed, 20 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 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] <INTENT>\n" +
" am startservice <INTENT>\n" +
" am force-stop <PACKAGE>\n" +
+ " am kill <PACKAGE>\n" +
+ " am kill-all\n" +
" am broadcast <INTENT>\n" +
" am instrument [-r] [-e <NAME> <VALUE>] [-p <FILE>] [-w]\n" +
" [--no-window-animation] <COMPONENT>\n" +
@@ -1202,6 +1216,12 @@ public class Am {
"\n" +
"am force-stop: force stop everything associated with <PACKAGE>.\n" +
"\n" +
+ "am kill: Kill all processes associated with <PACKAGE>. 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 <COMPONENT>\n" +