summaryrefslogtreecommitdiffstats
path: root/cmds/am
diff options
context:
space:
mode:
authorDianne Hackborn <hackbod@google.com>2015-04-10 14:02:33 -0700
committerDianne Hackborn <hackbod@google.com>2015-04-14 10:01:24 -0700
commit1e38382b542f5cef9957a89692b02c55a3dd351c (patch)
tree18c1b04b4e8f485fc3e6a99874d43e0161b8a8a4 /cmds/am
parent172753e6f851aa1905953b00d11a48873ff4bbb5 (diff)
downloadframeworks_base-1e38382b542f5cef9957a89692b02c55a3dd351c.zip
frameworks_base-1e38382b542f5cef9957a89692b02c55a3dd351c.tar.gz
frameworks_base-1e38382b542f5cef9957a89692b02c55a3dd351c.tar.bz2
Fixes to idle alarm scheduling, package importance.
- Add new API to ask the activity manager what the current importance of a particular package name is (along with a few new useful importance levels). - Fix my last alarm manager change to actually execute the alarms we have now decided should run even while we are idle. Change-Id: I1f14712b4e390770d53b185c96a1b36f6aadd687
Diffstat (limited to 'cmds/am')
-rw-r--r--cmds/am/src/com/android/commands/am/Am.java15
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));