merge in nyc-release history after reset to nyc-dev
diff --git a/src/com/android/ex/chips/RecipientEditTextView.java b/src/com/android/ex/chips/RecipientEditTextView.java
index e1a8faf..a27449a 100644
--- a/src/com/android/ex/chips/RecipientEditTextView.java
+++ b/src/com/android/ex/chips/RecipientEditTextView.java
@@ -103,8 +103,6 @@
 import java.util.List;
 import java.util.Map;
 import java.util.Set;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
 
 /**
  * RecipientEditTextView is an auto complete text view for use with applications
@@ -187,7 +185,7 @@
 
     private int mPendingChipsCount = 0;
     private int mCheckedItem;
-    private boolean mNoChips = false;
+    private boolean mNoChipMode = false;
     private boolean mShouldShrink = true;
     private boolean mRequiresShrinkWhenNotGone = false;
 
@@ -1114,6 +1112,11 @@
         return mChipHeight;
     }
 
+    /** Returns whether view is in no-chip or chip mode. */
+    public boolean isNoChipMode() {
+        return mNoChipMode;
+    }
+
     /**
      * Set whether to shrink the recipients field such that at most
      * one line of recipients chips are shown when the field loses
@@ -1204,7 +1207,7 @@
                 }
                 sanitizeEnd();
             } else {
-                mNoChips = true;
+                mNoChipMode = true;
             }
 
             if (mTemporaryRecipients != null && mTemporaryRecipients.size() > 0
@@ -1297,7 +1300,7 @@
         if (entry != null) {
             DrawableRecipientChip chip = null;
             try {
-                if (!mNoChips) {
+                if (!mNoChipMode) {
                     chip = visible ? constructChipSpan(entry) : new InvisibleRecipientChip(entry);
                 }
             } catch (NullPointerException e) {
@@ -1594,11 +1597,11 @@
     }
 
     private boolean shouldCreateChip(int start, int end) {
-        return !mNoChips && hasFocus() && enoughToFilter() && !alreadyHasChip(start, end);
+        return !mNoChipMode && hasFocus() && enoughToFilter() && !alreadyHasChip(start, end);
     }
 
     private boolean alreadyHasChip(int start, int end) {
-        if (mNoChips) {
+        if (mNoChipMode) {
             return true;
         }
         DrawableRecipientChip[] chips =
@@ -1968,7 +1971,7 @@
         // Always leave a blank space at the end of a chip.
         final int textLength = displayText.length() - 1;
         final SpannableString  chipText = new SpannableString(displayText);
-        if (!mNoChips) {
+        if (!mNoChipMode) {
             try {
                 DrawableRecipientChip chip = constructChipSpan(entry);
                 chipText.setSpan(chip, 0, textLength,
@@ -1988,7 +1991,7 @@
      * given RecipientEntry.
      */
     protected void onChipCreated(RecipientEntry entry) {
-        if (mRecipientChipAddedListener != null) {
+        if (!mNoChipMode && mRecipientChipAddedListener != null) {
             mRecipientChipAddedListener.onRecipientChipAdded(entry);
         }
     }
@@ -2179,7 +2182,7 @@
      */
     // Visible for testing.
     /* package */ void createMoreChip() {
-        if (mNoChips) {
+        if (mNoChipMode) {
             createMoreChipPlainText();
             return;
         }
@@ -2314,14 +2317,14 @@
              * editable text is not shown (i.e. chip is in user's contact list), chip is focused
              * and below callback is not called.
              */
-            if (mRecipientChipDeletedListener != null) {
+            if (!mNoChipMode && mRecipientChipDeletedListener != null) {
                 mRecipientChipDeletedListener.onRecipientChipDeleted(currentChip.getEntry());
             }
         } else {
             final boolean showAddress =
                     currentChip.getContactId() == RecipientEntry.GENERATED_CONTACT ||
                     getAdapter().forceShowAddress();
-            if (showAddress && mNoChips) {
+            if (showAddress && mNoChipMode) {
                 return;
             }
 
@@ -2402,7 +2405,7 @@
             QwertyKeyListener.markAsReplaced(editable, start, end, "");
             editable.removeSpan(chip);
             try {
-                if (!mNoChips) {
+                if (!mNoChipMode) {
                     editable.setSpan(constructChipSpan(chip.getEntry()),
                             start, end, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
                 }
@@ -2420,7 +2423,7 @@
     @Override
     public void onChipDelete() {
         if (mSelectedChip != null) {
-            if (mRecipientChipDeletedListener != null) {
+            if (!mNoChipMode && mRecipientChipDeletedListener != null) {
                 mRecipientChipDeletedListener.onRecipientChipDeleted(mSelectedChip.getEntry());
             }
             removeChip(mSelectedChip);
@@ -2626,7 +2629,7 @@
                     if (deleteEnd > editable.length()) {
                         deleteEnd = editable.length();
                     }
-                    if (mRecipientChipDeletedListener != null) {
+                    if (!mNoChipMode && mRecipientChipDeletedListener != null) {
                         mRecipientChipDeletedListener.onRecipientChipDeleted(toDelete.getEntry());
                     }
                     editable.removeSpan(toDelete);
@@ -2807,7 +2810,7 @@
     private class RecipientReplacementTask extends AsyncTask<Void, Void, Void> {
         private DrawableRecipientChip createFreeChip(RecipientEntry entry) {
             try {
-                if (mNoChips) {
+                if (mNoChipMode) {
                     return null;
                 }
                 return constructChipSpan(entry);