diff options
author | Dianne Hackborn <hackbod@google.com> | 2013-05-06 16:48:16 -0700 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2013-05-06 16:48:16 -0700 |
commit | a98b0ff812fb204eaa93e4cda848b054d70bbff0 (patch) | |
tree | 7e18358abeb46e02938d599babc172d8c1a9ab0a /cmds | |
parent | 1bc3e39ab48936bf82b8c11688ba0939e0866a44 (diff) | |
parent | d43a71dad80dfca65b0758f4333360516f6ad300 (diff) | |
download | frameworks_base-a98b0ff812fb204eaa93e4cda848b054d70bbff0.zip frameworks_base-a98b0ff812fb204eaa93e4cda848b054d70bbff0.tar.gz frameworks_base-a98b0ff812fb204eaa93e4cda848b054d70bbff0.tar.bz2 |
am d43a71da: Merge "Help for the debugging help for issue #8734824." into jb-mr2-dev
* commit 'd43a71dad80dfca65b0758f4333360516f6ad300':
Help for the debugging help for issue #8734824.
Diffstat (limited to 'cmds')
-rw-r--r-- | cmds/am/src/com/android/commands/am/Am.java | 23 |
1 files changed, 23 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 93658e1..61fe340 100644 --- a/cmds/am/src/com/android/commands/am/Am.java +++ b/cmds/am/src/com/android/commands/am/Am.java @@ -31,6 +31,7 @@ import android.content.Intent; import android.content.pm.IPackageManager; import android.content.pm.ResolveInfo; import android.net.Uri; +import android.os.Binder; import android.os.Bundle; import android.os.ParcelFileDescriptor; import android.os.RemoteException; @@ -94,6 +95,7 @@ public class Am extends BaseCommand { " am set-debug-app [-w] [--persistent] <PACKAGE>\n" + " am clear-debug-app\n" + " am monitor [--gdb <port>]\n" + + " am hang [--allow-restart]\n" + " am screen-compat [on|off] <PACKAGE>\n" + " am to-uri [INTENT]\n" + " am to-intent-uri [INTENT]\n" + @@ -169,6 +171,9 @@ public class Am extends BaseCommand { "am monitor: start monitoring for crashes or ANRs.\n" + " --gdb: start gdbserv on the given port at crash/ANR\n" + "\n" + + "am hang: hang the system.\n" + + " --allow-restart: allow watchdog to perform normal system restart\n" + + "\n" + "am screen-compat: control screen compatibility mode of <PACKAGE>.\n" + "\n" + "am to-uri: print the given Intent specification as a URI.\n" + @@ -249,6 +254,8 @@ public class Am extends BaseCommand { runBugReport(); } else if (op.equals("monitor")) { runMonitor(); + } else if (op.equals("hang")) { + runHang(); } else if (op.equals("screen-compat")) { runScreenCompat(); } else if (op.equals("to-uri")) { @@ -1304,6 +1311,22 @@ public class Am extends BaseCommand { controller.run(); } + private void runHang() throws Exception { + String opt; + boolean allowRestart = false; + while ((opt=nextOption()) != null) { + if (opt.equals("--allow-restart")) { + allowRestart = true; + } else { + System.err.println("Error: Unknown option: " + opt); + return; + } + } + + System.out.println("Hanging the system..."); + mAm.hang(new Binder(), allowRestart); + } + private void runScreenCompat() throws Exception { String mode = nextArgRequired(); boolean enabled; |