Remove the unneeded call to "findtokenstart"; we already have the token start
Part of b/7492291 First 2 contacts takes too long to resolve into chips when there are many contacts
and general speed improvements
4ms faster to create a chip
Change-Id: Ib016492cf63aa87ee3ace8e6bb7988fbe0a37749
diff --git a/src/com/android/ex/chips/RecipientEditTextView.java b/src/com/android/ex/chips/RecipientEditTextView.java
index c1000bf..c3c388d 100644
--- a/src/com/android/ex/chips/RecipientEditTextView.java
+++ b/src/com/android/ex/chips/RecipientEditTextView.java
@@ -896,15 +896,13 @@
if (entry != null) {
String destText = createAddressText(entry);
SpannableString chipText = new SpannableString(destText);
- int end = getSelectionEnd();
- int start = mTokenizer != null ? mTokenizer.findTokenStart(getText(), end) : 0;
RecipientChip chip = null;
try {
if (!mNoChips) {
/* leave space for the contact icon if this is not just an email address */
chip = constructChipSpan(
entry,
- start,
+ tokenStart,
false,
TextUtils.isEmpty(entry.getDisplayName())
|| TextUtils.equals(entry.getDisplayName(),