Repeatable ANR when pasting text into the recipient field
Bug 7998195
Add an escape clause to an infinite loop. The bug is 100% repro.
Change-Id: If4d4409a992ce29176ac8ef544a71b3649c1e6ee
diff --git a/chips/src/com/android/ex/chips/RecipientEditTextView.java b/chips/src/com/android/ex/chips/RecipientEditTextView.java
index 94b6062..4b1d53f 100644
--- a/chips/src/com/android/ex/chips/RecipientEditTextView.java
+++ b/chips/src/com/android/ex/chips/RecipientEditTextView.java
@@ -2344,6 +2344,9 @@
prevTokenStart = tokenStart;
tokenStart = mTokenizer.findTokenStart(text, tokenStart);
findChip = findChip(tokenStart);
+ if (tokenStart == originalTokenStart && findChip == null) {
+ break;
+ }
}
if (tokenStart != originalTokenStart) {
if (findChip != null) {