summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHenrik Engström <henrik.engstrom@sonyericsson.com>2012-02-21 09:05:17 +0100
committerHenrik Baard <henrik.baard@sonymobile.com>2012-04-20 12:49:13 +0200
commit9771a3144c8121877b5dc2fad439cfe378bc7a72 (patch)
tree0e50a22ca1078c7434cbac1b8bd464b1f0700690
parent60247737a7fa7f8e412b7047db4b5d33fe1d62a1 (diff)
downloadframeworks_base-9771a3144c8121877b5dc2fad439cfe378bc7a72.zip
frameworks_base-9771a3144c8121877b5dc2fad439cfe378bc7a72.tar.gz
frameworks_base-9771a3144c8121877b5dc2fad439cfe378bc7a72.tar.bz2
Fix for too many binder calls in packagemanager
The packagemanager uses a ParceledListSlice to send back its lists of installed packages and apps. The list slice has a method append which, in addition to adding the item to the list, also returns true if the list has passed a size limit (about 1/4 of the total possible IPC parcel size) to let the caller know that he should send the slice. However, when used by the pm, it has an extra ! that makes it send whenever it ISN'T over this limit instead (and conversely, not send if it is under). This causes a lot more calls than needed since it sends tiny one item slices instead of larger ones. This patch removes the extra ! making it behave correctly. Change-Id: I8db46d380a25406b55f3214aee1505e81949acc5
-rw-r--r--services/java/com/android/server/pm/PackageManagerService.java4
1 files changed, 2 insertions, 2 deletions
diff --git a/services/java/com/android/server/pm/PackageManagerService.java b/services/java/com/android/server/pm/PackageManagerService.java
index 6b61c47..938d93a 100644
--- a/services/java/com/android/server/pm/PackageManagerService.java
+++ b/services/java/com/android/server/pm/PackageManagerService.java
@@ -2573,7 +2573,7 @@ public class PackageManagerService extends IPackageManager.Stub {
}
}
- if (pi != null && !list.append(pi)) {
+ if (pi != null && list.append(pi)) {
break;
}
}
@@ -2620,7 +2620,7 @@ public class PackageManagerService extends IPackageManager.Stub {
}
}
- if (ai != null && !list.append(ai)) {
+ if (ai != null && list.append(ai)) {
break;
}
}