summaryrefslogtreecommitdiffstats
path: root/cmds
diff options
context:
space:
mode:
authorAshish Sharma <ashishsharma@google.com>2011-11-01 18:16:12 -0700
committerAshish Sharma <ashishsharma@google.com>2011-12-09 00:31:54 -0800
commit92a208c6d3e0fdae54bbc942e7e041e48812bcaa (patch)
tree061f326b5e1e58b7545336ebdb4c003d8889b3c3 /cmds
parentd3209c1bb21ce026d4e41464740e3d8f57cdd56f (diff)
downloadframeworks_base-92a208c6d3e0fdae54bbc942e7e041e48812bcaa.zip
frameworks_base-92a208c6d3e0fdae54bbc942e7e041e48812bcaa.tar.gz
frameworks_base-92a208c6d3e0fdae54bbc942e7e041e48812bcaa.tar.bz2
Add a command option to display installerPackageName
Change-Id: I2e5cb5891c610531d9ba7c359fd5dd521f8ecfec
Diffstat (limited to 'cmds')
-rw-r--r--cmds/pm/src/com/android/commands/pm/Pm.java13
1 files changed, 11 insertions, 2 deletions
diff --git a/cmds/pm/src/com/android/commands/pm/Pm.java b/cmds/pm/src/com/android/commands/pm/Pm.java
index 0ec007c..c0ba543 100644
--- a/cmds/pm/src/com/android/commands/pm/Pm.java
+++ b/cmds/pm/src/com/android/commands/pm/Pm.java
@@ -212,6 +212,7 @@ public final class Pm {
int getFlags = 0;
boolean listDisabled = false, listEnabled = false;
boolean listSystem = false, listThirdParty = false;
+ boolean listInstaller = false;
try {
String opt;
while ((opt=nextOption()) != null) {
@@ -229,6 +230,8 @@ public final class Pm {
listSystem = true;
} else if (opt.equals("-3")) {
listThirdParty = true;
+ } else if (opt.equals("-i")) {
+ listInstaller = true;
} else if (opt.equals("-u")) {
getFlags |= PackageManager.GET_UNINSTALLED_PACKAGES;
} else {
@@ -265,7 +268,12 @@ public final class Pm {
System.out.print(info.applicationInfo.sourceDir);
System.out.print("=");
}
- System.out.println(info.packageName);
+ System.out.print(info.packageName);
+ if (listInstaller) {
+ System.out.print(" installer=");
+ System.out.print(mPm.getInstallerPackageName(info.packageName));
+ }
+ System.out.println();
}
}
} catch (RemoteException e) {
@@ -1109,7 +1117,7 @@ public final class Pm {
}
private static void showUsage() {
- System.err.println("usage: pm list packages [-f] [-d] [-e] [-s] [-e] [-u] [FILTER]");
+ System.err.println("usage: pm list packages [-f] [-d] [-e] [-s] [-3] [-i] [-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]");
@@ -1134,6 +1142,7 @@ public final class Pm {
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(" -i: see the installer for the packages.");
System.err.println(" -u: also include uninstalled packages.");
System.err.println("");
System.err.println("pm list permission-groups: prints all known permission groups.");