diff options
author | Kenny Root <kroot@google.com> | 2013-05-07 10:14:28 -0700 |
---|---|---|
committer | Kenny Root <kroot@google.com> | 2013-05-07 10:14:46 -0700 |
commit | 1d69bad411123913d32342864454b09ae39dab2c (patch) | |
tree | 1ed91eb3bc121b8509ea65b4404ebc565223d880 /cmds/am | |
parent | 1d41cae973579c07e1594d0496a1847cd644b8c0 (diff) | |
parent | a98b0ff812fb204eaa93e4cda848b054d70bbff0 (diff) | |
download | frameworks_base-1d69bad411123913d32342864454b09ae39dab2c.zip frameworks_base-1d69bad411123913d32342864454b09ae39dab2c.tar.gz frameworks_base-1d69bad411123913d32342864454b09ae39dab2c.tar.bz2 |
resolved conflicts for merge of a98b0ff8 to master
Change-Id: I1f4a952d360c48426e22a7772726b6867cc19771
Diffstat (limited to 'cmds/am')
-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 dca873e..ce71e4a 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; @@ -95,6 +96,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" + @@ -173,6 +175,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" + @@ -265,6 +270,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")) { @@ -1320,6 +1327,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; |