summaryrefslogtreecommitdiffstats
path: root/chips
diff options
context:
space:
mode:
authorjli119X <jianpingx.li@intel.com>2012-10-18 12:55:47 +0800
committerScott Kennedy <skennedy@google.com>2013-03-14 13:24:07 -0700
commit8b7e1e5760f236a505ce2e91563e8ac5d75af7cc (patch)
treeeab9bc2dc802851ae7359475028ff34d4daf0e54 /chips
parente46cb66d4265b6fb8800f9120086151b36011f0f (diff)
downloadandroid_frameworks_ex-8b7e1e5760f236a505ce2e91563e8ac5d75af7cc.tar.gz
android_frameworks_ex-8b7e1e5760f236a505ce2e91563e8ac5d75af7cc.tar.bz2
android_frameworks_ex-8b7e1e5760f236a505ce2e91563e8ac5d75af7cc.zip
Cherry-pick Fix a Dead Loop issue in RecipientEditTextView
From AOSP: I01183680289919105dadc28ffd40c8e60dfd6b7e The old code logic will cause dead loop when pasting phone number to recipient. Change-Id: I608f1bf2a5d5651f51be419f7b6125358f2389e2 Author: Jianping Li <jianpingx.li@intel.com> Signed-off-by: Jianping Li <jianpingx.li@intel.com> Signed-off-by: Shuo Gao <shuo.gao@intel.com> Signed-off-by: Bruce Beare <bruce.j.beare@intel.com> Signed-off-by: Jack Ren <jack.ren@intel.com> Author-tracking-BZ: 58793
Diffstat (limited to 'chips')
-rw-r--r--chips/src/com/android/ex/chips/RecipientEditTextView.java4
1 files changed, 2 insertions, 2 deletions
diff --git a/chips/src/com/android/ex/chips/RecipientEditTextView.java b/chips/src/com/android/ex/chips/RecipientEditTextView.java
index 67f5147..4347202 100644
--- a/chips/src/com/android/ex/chips/RecipientEditTextView.java
+++ b/chips/src/com/android/ex/chips/RecipientEditTextView.java
@@ -2347,12 +2347,12 @@ public class RecipientEditTextView extends MultiAutoCompleteTextView implements
int originalTokenStart = mTokenizer.findTokenStart(text, getSelectionEnd());
String lastAddress = text.substring(originalTokenStart);
int tokenStart = originalTokenStart;
- int prevTokenStart = tokenStart;
+ int prevTokenStart = 0;
DrawableRecipientChip findChip = null;
ArrayList<DrawableRecipientChip> created = new ArrayList<DrawableRecipientChip>();
if (tokenStart != 0) {
// There are things before this!
- while (tokenStart != 0 && findChip == null) {
+ while (tokenStart != 0 && findChip == null && tokenStart != prevTokenStart) {
prevTokenStart = tokenStart;
tokenStart = mTokenizer.findTokenStart(text, tokenStart);
findChip = findChip(tokenStart);