From d8e1dbb6bc1fbaf4f2e38c3ba92ced94270deaac Mon Sep 17 00:00:00 2001 From: Dianne Hackborn Date: Thu, 17 Jan 2013 17:47:37 -0800 Subject: 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 --- cmds/pm/src/com/android/commands/pm/Pm.java | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) (limited to 'cmds/pm') 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 getInstalledPackages(IPackageManager pm, int flags, int userId) throws RemoteException { - final List packageInfos = new ArrayList(); - PackageInfo lastItem = null; - ParceledListSlice 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 slice = pm.getInstalledPackages(flags, userId); + return slice.getList(); } /** -- cgit v1.1