diff options
Diffstat (limited to 'cmds/pm')
-rw-r--r-- | cmds/pm/src/com/android/commands/pm/Pm.java | 28 |
1 files changed, 21 insertions, 7 deletions
diff --git a/cmds/pm/src/com/android/commands/pm/Pm.java b/cmds/pm/src/com/android/commands/pm/Pm.java index f2b6fce..1b2326a 100644 --- a/cmds/pm/src/com/android/commands/pm/Pm.java +++ b/cmds/pm/src/com/android/commands/pm/Pm.java @@ -194,6 +194,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) { @@ -207,6 +208,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 { @@ -232,8 +237,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); @@ -276,7 +285,7 @@ public final class Pm { for (int i=0; i<rawList.length; i++) { list.add(rawList[i]); } - + // Sort by name Collections.sort(list, new Comparator<FeatureInfo>() { @@ -784,10 +793,10 @@ public final class Pm { boolean finished; boolean result; - public void packageDeleted(boolean succeeded) { + public void packageDeleted(String packageName, int returnCode) { synchronized (this) { finished = true; - result = succeeded; + result = returnCode == PackageManager.DELETE_SUCCEEDED; notifyAll(); } } @@ -1010,7 +1019,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]"); @@ -1027,8 +1036,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"); @@ -1045,6 +1056,9 @@ public final class Pm { System.err.println("The list instrumentation command prints all instrumentations,"); System.err.println("or only those that target a specified package. Options:"); System.err.println(" -f: see their associated file."); + System.err.println("(Use this command to list all test packages, or use <TARGET-PACKAGE> "); + System.err.println(" to list the test packages for a particular application. The -f "); + System.err.println(" option lists the .apk file for the test package.)"); System.err.println(""); System.err.println("The list features command prints all features of the system."); System.err.println(""); |