diff options
author | calderwoodra <calderwoodra@google.com> | 2017-08-16 23:15:39 -0700 |
---|---|---|
committer | Eric Erfanian <erfanian@google.com> | 2017-08-30 15:45:09 +0000 |
commit | dccc7d9438d8155d405d2e956d3e3b56135cb888 (patch) | |
tree | 869fdd3de9c282183943dd85fe5596627616b21b /java/com/android/dialer/searchfragment/cp2 | |
parent | b9263861fd78777e4bbc3a2f7716d90a3cfccb26 (diff) |
Fix a crash in new search ui.
Bug: 64691685
Test: existing
PiperOrigin-RevId: 165543678
Change-Id: Ibeecc8f46310ad83cf7ccd86694b013bb222f184
Diffstat (limited to 'java/com/android/dialer/searchfragment/cp2')
-rw-r--r-- | java/com/android/dialer/searchfragment/cp2/ContactFilterCursor.java | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/java/com/android/dialer/searchfragment/cp2/ContactFilterCursor.java b/java/com/android/dialer/searchfragment/cp2/ContactFilterCursor.java index d5fcfba4f..6fd053cae 100644 --- a/java/com/android/dialer/searchfragment/cp2/ContactFilterCursor.java +++ b/java/com/android/dialer/searchfragment/cp2/ContactFilterCursor.java @@ -125,8 +125,9 @@ final class ContactFilterCursor implements Cursor { continue; case Qualification.NEW_NUMBER_IS_MORE_QUALIFIED: // If number wasn't filtered out before, remove it and add it's more qualified version. - if (queryFilteredPositions.contains(previousMostQualifiedPosition)) { - queryFilteredPositions.remove(previousMostQualifiedPosition); + int index = queryFilteredPositions.indexOf(previousMostQualifiedPosition); + if (index != -1) { + queryFilteredPositions.remove(index); queryFilteredPositions.add(position); } previousMostQualifiedNumber = currentNumber; |