summaryrefslogtreecommitdiffstats
path: root/cmds
diff options
context:
space:
mode:
authorDianne Hackborn <hackbod@google.com>2011-05-11 17:34:49 -0700
committerDianne Hackborn <hackbod@google.com>2011-05-12 13:28:45 -0700
commit0f1de9adde0b52d2a385a76232bd7ac30c3eeea2 (patch)
tree6d30064324ea987411955a88cb0272ddb27d39b2 /cmds
parentf3cdea937b8b659f959d5e77f4a17f749f85c6ae (diff)
downloadframeworks_base-0f1de9adde0b52d2a385a76232bd7ac30c3eeea2.zip
frameworks_base-0f1de9adde0b52d2a385a76232bd7ac30c3eeea2.tar.gz
frameworks_base-0f1de9adde0b52d2a385a76232bd7ac30c3eeea2.tar.bz2
New compat mode front end: UI and persistence.
Adds a really crappy UI for toggling compat mode. Persists compat mode selection across boots. Turns on compat mode by default for newly installed apps. Change-Id: Idc83494397bd17c41450bc9e9a05e4386c509399
Diffstat (limited to 'cmds')
-rw-r--r--cmds/am/src/com/android/commands/am/Am.java5
-rw-r--r--cmds/pm/src/com/android/commands/pm/Pm.java19
2 files changed, 19 insertions, 5 deletions
diff --git a/cmds/am/src/com/android/commands/am/Am.java b/cmds/am/src/com/android/commands/am/Am.java
index 5c8abe4..8a9144c 100644
--- a/cmds/am/src/com/android/commands/am/Am.java
+++ b/cmds/am/src/com/android/commands/am/Am.java
@@ -18,6 +18,7 @@
package com.android.commands.am;
+import android.app.ActivityManager;
import android.app.ActivityManagerNative;
import android.app.IActivityController;
import android.app.IActivityManager;
@@ -794,7 +795,9 @@ public class Am {
String packageName = nextArgRequired();
do {
try {
- mAm.setPackageScreenCompatMode(packageName, enabled);
+ mAm.setPackageScreenCompatMode(packageName, enabled
+ ? ActivityManager.COMPAT_MODE_ENABLED
+ : ActivityManager.COMPAT_MODE_DISABLED);
} catch (RemoteException e) {
}
packageName = nextArg();
diff --git a/cmds/pm/src/com/android/commands/pm/Pm.java b/cmds/pm/src/com/android/commands/pm/Pm.java
index d058e38..b759de0 100644
--- a/cmds/pm/src/com/android/commands/pm/Pm.java
+++ b/cmds/pm/src/com/android/commands/pm/Pm.java
@@ -193,6 +193,7 @@ public final class Pm {
private void runListPackages(boolean showApplicationPackage) {
int getFlags = 0;
boolean listDisabled = false, listEnabled = false;
+ boolean listSystem = false, listThirdParty = false;
try {
String opt;
while ((opt=nextOption()) != null) {
@@ -206,6 +207,10 @@ public final class Pm {
listDisabled = true;
} else if (opt.equals("-e")) {
listEnabled = true;
+ } else if (opt.equals("-s")) {
+ listSystem = true;
+ } else if (opt.equals("-3")) {
+ listThirdParty = true;
} else if (opt.equals("-u")) {
getFlags |= PackageManager.GET_UNINSTALLED_PACKAGES;
} else {
@@ -231,8 +236,12 @@ public final class Pm {
if (filter != null && !info.packageName.contains(filter)) {
continue;
}
+ final boolean isSystem =
+ (info.applicationInfo.flags&ApplicationInfo.FLAG_SYSTEM) != 0;
if ((!listDisabled || !info.applicationInfo.enabled) &&
- (!listEnabled || info.applicationInfo.enabled)) {
+ (!listEnabled || info.applicationInfo.enabled) &&
+ (!listSystem || isSystem) &&
+ (!listThirdParty || !isSystem)) {
System.out.print("package:");
if (showApplicationPackage) {
System.out.print(info.applicationInfo.sourceDir);
@@ -993,7 +1002,7 @@ public final class Pm {
private static void showUsage() {
System.err.println("usage: pm [list|path|install|uninstall]");
- System.err.println(" pm list packages [-f] [-d] [-e] [-u] [FILTER]");
+ System.err.println(" pm list packages [-f] [-d] [-e] [-s] [-e] [-u] [FILTER]");
System.err.println(" pm list permission-groups");
System.err.println(" pm list permissions [-g] [-f] [-d] [-u] [GROUP]");
System.err.println(" pm list instrumentation [-f] [TARGET-PACKAGE]");
@@ -1010,8 +1019,10 @@ public final class Pm {
System.err.println("The list packages command prints all packages, optionally only");
System.err.println("those whose package name contains the text in FILTER. Options:");
System.err.println(" -f: see their associated file.");
- System.err.println(" -d: filter to include disbled packages.");
- System.err.println(" -e: filter to include enabled packages.");
+ System.err.println(" -d: filter to only show disbled packages.");
+ System.err.println(" -e: filter to only show enabled packages.");
+ System.err.println(" -s: filter to only show system packages.");
+ System.err.println(" -3: filter to only show third party packages.");
System.err.println(" -u: also include uninstalled packages.");
System.err.println("");
System.err.println("The list permission-groups command prints all known");