diff options
author | Treehugger Robot <treehugger-gerrit@google.com> | 2017-12-19 23:02:34 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2017-12-19 23:02:34 +0000 |
commit | f976beb4b56b9b0b1ea17c6466d79b16a4eb7477 (patch) | |
tree | 4538bd3030d9cfaf2fa602f693bc483e8d947e11 /java/com/android/dialer/app/list/SmartDialNumberListAdapter.java | |
parent | 0f76636bba4a2c01663c98fa4f3a88d3435e45d7 (diff) | |
parent | e12f924c45d9e40dbdd23ad01b7bde855b82c4c8 (diff) |
Merge changes Ic5616af0,I5e4c3e61
* changes:
Add flags for the Duo install, activate and invite buttons
Support dual alphabets in smart dial.
Diffstat (limited to 'java/com/android/dialer/app/list/SmartDialNumberListAdapter.java')
-rw-r--r-- | java/com/android/dialer/app/list/SmartDialNumberListAdapter.java | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/java/com/android/dialer/app/list/SmartDialNumberListAdapter.java b/java/com/android/dialer/app/list/SmartDialNumberListAdapter.java index 3b00c7643..5b48ccfd0 100644 --- a/java/com/android/dialer/app/list/SmartDialNumberListAdapter.java +++ b/java/com/android/dialer/app/list/SmartDialNumberListAdapter.java @@ -25,7 +25,6 @@ import com.android.dialer.common.LogUtil; import com.android.dialer.dialpadview.SmartDialCursorLoader; import com.android.dialer.smartdial.SmartDialMatchPosition; import com.android.dialer.smartdial.SmartDialNameMatcher; -import com.android.dialer.smartdial.SmartDialPrefix; import com.android.dialer.util.CallUtil; import java.util.ArrayList; @@ -35,11 +34,13 @@ public class SmartDialNumberListAdapter extends DialerPhoneNumberListAdapter { private static final String TAG = SmartDialNumberListAdapter.class.getSimpleName(); private static final boolean DEBUG = false; + private final Context mContext; @NonNull private final SmartDialNameMatcher mNameMatcher; public SmartDialNumberListAdapter(Context context) { super(context); - mNameMatcher = new SmartDialNameMatcher("", SmartDialPrefix.getMap()); + mContext = context; + mNameMatcher = new SmartDialNameMatcher(""); setShortcutEnabled(SmartDialNumberListAdapter.SHORTCUT_DIRECT_CALL, false); if (DEBUG) { @@ -72,7 +73,7 @@ public class SmartDialNumberListAdapter extends DialerPhoneNumberListAdapter { protected void setHighlight(ContactListItemView view, Cursor cursor) { view.clearHighlightSequences(); - if (mNameMatcher.matches(cursor.getString(PhoneQuery.DISPLAY_NAME))) { + if (mNameMatcher.matches(mContext, cursor.getString(PhoneQuery.DISPLAY_NAME))) { final ArrayList<SmartDialMatchPosition> nameMatches = mNameMatcher.getMatchPositions(); for (SmartDialMatchPosition match : nameMatches) { view.addNameHighlightSequence(match.start, match.end); @@ -89,7 +90,7 @@ public class SmartDialNumberListAdapter extends DialerPhoneNumberListAdapter { } final SmartDialMatchPosition numberMatch = - mNameMatcher.matchesNumber(cursor.getString(PhoneQuery.PHONE_NUMBER)); + mNameMatcher.matchesNumber(mContext, cursor.getString(PhoneQuery.PHONE_NUMBER)); if (numberMatch != null) { view.addNumberHighlightSequence(numberMatch.start, numberMatch.end); } |