Skip to content

Commit 9771a31

Browse files
Henrik EngströmHenrik Baard
authored andcommitted
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
1 parent 6024773 commit 9771a31

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

services/java/com/android/server/pm/PackageManagerService.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2573,7 +2573,7 @@ public ParceledListSlice<PackageInfo> getInstalledPackages(int flags, String las
25732573
}
25742574
}
25752575

2576-
if (pi != null && !list.append(pi)) {
2576+
if (pi != null && list.append(pi)) {
25772577
break;
25782578
}
25792579
}
@@ -2620,7 +2620,7 @@ public ParceledListSlice<ApplicationInfo> getInstalledApplications(int flags,
26202620
}
26212621
}
26222622

2623-
if (ai != null && !list.append(ai)) {
2623+
if (ai != null && list.append(ai)) {
26242624
break;
26252625
}
26262626
}

0 commit comments

Comments
 (0)