diff options
Diffstat (limited to 'cmds')
-rw-r--r-- | cmds/am/src/com/android/commands/am/Am.java | 15 |
1 files changed, 15 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 908d46e..fa28143 100644 --- a/cmds/am/src/com/android/commands/am/Am.java +++ b/cmds/am/src/com/android/commands/am/Am.java @@ -124,6 +124,7 @@ public class Am extends BaseCommand { " am restart\n" + " am idle-maintenance\n" + " am screen-compat [on|off] <PACKAGE>\n" + + " am package-importance <PACKAGE>\n" + " am to-uri [INTENT]\n" + " am to-intent-uri [INTENT]\n" + " am to-app-uri [INTENT]\n" + @@ -233,6 +234,8 @@ public class Am extends BaseCommand { "\n" + "am screen-compat: control screen compatibility mode of <PACKAGE>.\n" + "\n" + + "am package-importance: print current importance of <PACKAGE>.\n" + + "\n" + "am to-uri: print the given Intent specification as a URI.\n" + "\n" + "am to-intent-uri: print the given Intent specification as an intent: URI.\n" + @@ -365,6 +368,8 @@ public class Am extends BaseCommand { runIdleMaintenance(); } else if (op.equals("screen-compat")) { runScreenCompat(); + } else if (op.equals("package-importance")) { + runPackageImportance(); } else if (op.equals("to-uri")) { runToUri(0); } else if (op.equals("to-intent-uri")) { @@ -1604,6 +1609,16 @@ public class Am extends BaseCommand { } while (packageName != null); } + private void runPackageImportance() throws Exception { + String packageName = nextArgRequired(); + try { + int procState = mAm.getPackageProcessState(packageName); + System.out.println( + ActivityManager.RunningAppProcessInfo.procStateToImportance(procState)); + } catch (RemoteException e) { + } + } + private void runToUri(int flags) throws Exception { Intent intent = makeIntent(UserHandle.USER_CURRENT); System.out.println(intent.toUri(flags)); |