ResolverComparator transitivity

Fix a bug where ResolverComparator's results were not consistent for
targets that cross profile boundaries.

Bug: 31640894
Change-Id: Ic6bf9512d2c2eb6f8fb7851e18eb9a347db29755
This commit is contained in:
Adam Powell
2016-09-23 10:32:04 -07:00
parent 18fb24c5d3
commit 2366ff12a2

View File

@@ -157,7 +157,10 @@ class ResolverComparator implements Comparator<ResolvedComponentInfo> {
// We want to put the one targeted to another user at the end of the dialog.
if (lhs.targetUserId != UserHandle.USER_CURRENT) {
return 1;
return rhs.targetUserId != UserHandle.USER_CURRENT ? 0 : 1;
}
if (rhs.targetUserId != UserHandle.USER_CURRENT) {
return -1;
}
if (mHttp) {