Count the line "Create new contact"
Bug: 2479489

Change-Id: Idfc3b32350d22bc82674c20d25a492550180d97d
diff --git a/src/com/android/contacts/ContactsListActivity.java b/src/com/android/contacts/ContactsListActivity.java
index 1361ae5..db182c7 100644
--- a/src/com/android/contacts/ContactsListActivity.java
+++ b/src/com/android/contacts/ContactsListActivity.java
@@ -3183,6 +3183,7 @@
                 return 0;
             }
             int superCount = super.getCount();
+
             if (mShowNumberOfContacts && (mSearchMode || superCount > 0)) {
                 // We don't want to count this header if it's the only thing visible, so that
                 // the empty text will display.
@@ -3194,6 +3195,12 @@
                 superCount++;
             }
 
+            // We do not show the "Create New" button in Search mode
+            if ((mMode & MODE_MASK_CREATE_NEW) != 0 && !mSearchMode) {
+                // Count the "Create new contact" line
+                superCount++;
+            }
+
             if (mSuggestionsCursorCount != 0) {
                 // When showing suggestions, we have 2 additional list items: the "Suggestions"
                 // and "All contacts" headers.