summaryrefslogtreecommitdiffstats
path: root/cmds/pm
diff options
context:
space:
mode:
authorKenny Root <kroot@google.com>2011-05-19 12:48:14 -0700
committerKenny Root <kroot@google.com>2011-05-19 12:48:14 -0700
commite6cd0c747e76723bc51a23925c239ae10f9d3b5c (patch)
tree6fd4fa9f3e207f5a0aaf50edf972374196390a49 /cmds/pm
parent0a36cec642fb58e295d0608026890d95d0ae3cc0 (diff)
parent2433c443bb5fe96d9a39b59e10e3c03d791e2278 (diff)
downloadframeworks_base-e6cd0c747e76723bc51a23925c239ae10f9d3b5c.zip
frameworks_base-e6cd0c747e76723bc51a23925c239ae10f9d3b5c.tar.gz
frameworks_base-e6cd0c747e76723bc51a23925c239ae10f9d3b5c.tar.bz2
resolved conflicts for merge of 2433c443 to honeycomb-plus-aosp
Change-Id: I3385f57e5761679e6700bcbe3c41deb3ecd43ba1
Diffstat (limited to 'cmds/pm')
-rw-r--r--cmds/pm/src/com/android/commands/pm/Pm.java21
1 files changed, 19 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 b759de0..1b2326a 100644
--- a/cmds/pm/src/com/android/commands/pm/Pm.java
+++ b/cmds/pm/src/com/android/commands/pm/Pm.java
@@ -30,14 +30,15 @@ import android.content.pm.InstrumentationInfo;
import android.content.pm.PackageInfo;
import android.content.pm.PackageItemInfo;
import android.content.pm.PackageManager;
+import android.content.pm.ParceledListSlice;
import android.content.pm.PermissionGroupInfo;
import android.content.pm.PermissionInfo;
import android.content.res.AssetManager;
import android.content.res.Resources;
import android.net.Uri;
+import android.os.Parcel;
import android.os.RemoteException;
import android.os.ServiceManager;
-import android.provider.Settings;
import java.io.File;
import java.lang.reflect.Field;
@@ -228,7 +229,7 @@ public final class Pm {
String filter = nextArg();
try {
- List<PackageInfo> packages = mPm.getInstalledPackages(getFlags);
+ final List<PackageInfo> packages = getInstalledPackages(mPm, getFlags);
int count = packages.size();
for (int p = 0 ; p < count ; p++) {
@@ -256,6 +257,22 @@ public final class Pm {
}
}
+ @SuppressWarnings("unchecked")
+ private List<PackageInfo> getInstalledPackages(IPackageManager pm, int flags)
+ 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);
+ lastItem = slice.populateList(packageInfos, PackageInfo.CREATOR);
+ } while (!slice.isLastSlice());
+
+ return packageInfos;
+ }
+
/**
* Lists all of the features supported by the current device.
*