Make sure that the last "fake entry" chip is correctly committed
Fix logic to correctly determine that this "recipient chip" is really
text
Fixes part of b/7481045 recipient address briefly drawn w/o friendly name
Change-Id: I4c5244581a4fce5de58d6d9c510e1df16674c338
diff --git a/src/com/android/ex/chips/RecipientEditTextView.java b/src/com/android/ex/chips/RecipientEditTextView.java
index 215ab60..7a3c619 100644
--- a/src/com/android/ex/chips/RecipientEditTextView.java
+++ b/src/com/android/ex/chips/RecipientEditTextView.java
@@ -398,8 +398,9 @@
if (mTokenizer == null) {
return;
}
- if (mSelectedChip != null
- && shouldShowEditableText(mSelectedChip)) {
+ long contactId = mSelectedChip != null ? mSelectedChip.getEntry().getContactId() : -1;
+ if (mSelectedChip != null && contactId != RecipientEntry.INVALID_CONTACT
+ && (!isPhoneQuery() && contactId != RecipientEntry.GENERATED_CONTACT)) {
clearSelectedChip();
} else {
if (getWidth() <= 0) {