Prevent crash when removing duplicates
The method that crashes is removed in O-DR, and thus does not need to be merged down. Change-Id: If30bd8bd92d578133984f7f35e7ec5288adfc390 Fixes: 62100634 Test: make RunSettingsRoboTests Merged-In: Id36f7bf4ceaaa3a2bd326ecafbfe97fd0b247df2
This commit is contained in:
@@ -323,18 +323,18 @@ public class DatabaseResultLoader extends AsyncLoader<List<? extends SearchResul
|
||||
for (int j = i - 1; j >= 0; j--) {
|
||||
primaryResult = results.get(j);
|
||||
if (areDuplicateResults(primaryResult, secondaryResult)) {
|
||||
|
||||
if (primaryResult.viewType != ResultPayload.PayloadType.INTENT) {
|
||||
// Case where both payloads are inline
|
||||
results.remove(i);
|
||||
break;
|
||||
} else if (secondaryResult.viewType != ResultPayload.PayloadType.INTENT) {
|
||||
// Case where only second result is inline
|
||||
// Case where only second result is inline.
|
||||
results.remove(j);
|
||||
i--; // shift the top index to reflect the lower element being removed
|
||||
} else {
|
||||
// Case where both payloads are intent
|
||||
// Case where both payloads are intent.
|
||||
results.remove(i);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user