summaryrefslogtreecommitdiffstats
path: root/cmds/pm
diff options
context:
space:
mode:
authorDianne Hackborn <hackbod@google.com>2013-01-17 17:47:37 -0800
committerDianne Hackborn <hackbod@google.com>2013-01-18 13:02:26 -0800
commitd8e1dbb6bc1fbaf4f2e38c3ba92ced94270deaac (patch)
tree5f6d8b2c0e66c99289ae085cb6a6a3be168eb000 /cmds/pm
parentf25febf01453733e8bdd1ac241ecd9d3bcbef475 (diff)
downloadframeworks_base-d8e1dbb6bc1fbaf4f2e38c3ba92ced94270deaac.zip
frameworks_base-d8e1dbb6bc1fbaf4f2e38c3ba92ced94270deaac.tar.gz
frameworks_base-d8e1dbb6bc1fbaf4f2e38c3ba92ced94270deaac.tar.bz2
Rework ParceledListSlice to be much easier to use.
Take advantage of this to return better information about packages filtered by permissions -- include the permissions they have in the requested array. Also fix issue #8026793 (Contact picture shows default pic while searching for a contact in qsb) by using the base package name of the Context when reporting the app name of an operation. Otherwise you could make a resource-only context for another application and do calls through that and get reported as the wrong app. Change-Id: I5e0488bf773acea5a3d22f245641828e1a106fb8
Diffstat (limited to 'cmds/pm')
-rw-r--r--cmds/pm/src/com/android/commands/pm/Pm.java13
1 files changed, 2 insertions, 11 deletions
diff --git a/cmds/pm/src/com/android/commands/pm/Pm.java b/cmds/pm/src/com/android/commands/pm/Pm.java
index 42c9d34..39539b4 100644
--- a/cmds/pm/src/com/android/commands/pm/Pm.java
+++ b/cmds/pm/src/com/android/commands/pm/Pm.java
@@ -321,17 +321,8 @@ public final class Pm {
@SuppressWarnings("unchecked")
private List<PackageInfo> getInstalledPackages(IPackageManager pm, int flags, int userId)
throws RemoteException {
- final List<PackageInfo> packageInfos = new ArrayList<PackageInfo>();
- PackageInfo lastItem = null;
- ParceledListSlice<PackageInfo> slice;
-
- do {
- final String lastKey = lastItem != null ? lastItem.packageName : null;
- slice = pm.getInstalledPackages(flags, lastKey, userId);
- lastItem = slice.populateList(packageInfos, PackageInfo.CREATOR);
- } while (!slice.isLastSlice());
-
- return packageInfos;
+ ParceledListSlice<PackageInfo> slice = pm.getInstalledPackages(flags, userId);
+ return slice.getList();
}
/**