From 9771a3144c8121877b5dc2fad439cfe378bc7a72 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Engstr=C3=B6m?= Date: Tue, 21 Feb 2012 09:05:17 +0100 Subject: [PATCH] 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 --- .../java/com/android/server/pm/PackageManagerService.java | 4 ++-- 1 file 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 6b61c47db696f..938d93a74df9a 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; } }