summaryrefslogtreecommitdiffstats
path: root/cmds/pm
diff options
context:
space:
mode:
authorKenny Root <kroot@google.com>2011-05-19 15:02:18 -0700
committerKenny Root <kroot@google.com>2011-05-19 15:02:18 -0700
commita51b6fd6f8a53f040894ef07cf23695581595e6b (patch)
treeb2e2b02e6a0568054fa279c54f50b7d2c80a9b18 /cmds/pm
parent3a9e712aca65ac49e7155e98e5d6b815da76f94b (diff)
parentb2d0ee164a1cf7bab31302c5d3cdd62322574271 (diff)
downloadframeworks_base-a51b6fd6f8a53f040894ef07cf23695581595e6b.zip
frameworks_base-a51b6fd6f8a53f040894ef07cf23695581595e6b.tar.gz
frameworks_base-a51b6fd6f8a53f040894ef07cf23695581595e6b.tar.bz2
resolved conflicts for merge of b2d0ee16 to master
Change-Id: I4483a6d0ccecfea4a1e66bb6eba80d13e8b9a3a4
Diffstat (limited to 'cmds/pm')
-rw-r--r--cmds/pm/src/com/android/commands/pm/Pm.java20
1 files changed, 19 insertions, 1 deletions
diff --git a/cmds/pm/src/com/android/commands/pm/Pm.java b/cmds/pm/src/com/android/commands/pm/Pm.java
index 701c7ac..b0e4a86 100644
--- a/cmds/pm/src/com/android/commands/pm/Pm.java
+++ b/cmds/pm/src/com/android/commands/pm/Pm.java
@@ -30,11 +30,13 @@ 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.Process;
import android.os.RemoteException;
import android.os.ServiceManager;
@@ -239,7 +241,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++) {
@@ -267,6 +269,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.
*