Merge "Only show one line for group summary text view." into ub-contactsdialer-a-dev
diff --git a/res/values/strings.xml b/res/values/strings.xml
index 1465d83..a211c20 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -897,11 +897,11 @@
     <string name="editor_delete_view_description_short">Delete <xliff:g id="data_kind">%s</xliff:g></string>
 
     <!-- Content description of photo in photo picker indicating a photo from a specific account is *not* selected.
-         For example: Photo from Google abc@gmail.com not checked. [CHAR LIMIT=30]-->
+         For example: Photo from Google abc@gmail.com not checked. [CHAR LIMIT=60]-->
     <string name="photo_view_description_not_checked">Photo from <xliff:g id="account_type">%s </xliff:g><xliff:g id="user_name">%s </xliff:g>not checked</string>
 
     <!-- Content description of photo in photo picker indicating a photo from a specific account is selected.
-         For example: Photo from Google abc@gmail.com checked. [CHAR LIMIT=30]-->
+         For example: Photo from Google abc@gmail.com checked. [CHAR LIMIT=60]-->
     <string name="photo_view_description_checked">Photo from <xliff:g id="account_type">%s </xliff:g><xliff:g id="user_name">%s </xliff:g>checked</string>
 
 </resources>
diff --git a/src/com/android/contacts/editor/KindSectionDataList.java b/src/com/android/contacts/editor/KindSectionDataList.java
index 7a7dec2..07c8158 100644
--- a/src/com/android/contacts/editor/KindSectionDataList.java
+++ b/src/com/android/contacts/editor/KindSectionDataList.java
@@ -105,11 +105,13 @@
         // Just return the first writable entry.
         for (KindSectionData kindSectionData : this) {
             if (kindSectionData.getAccountType().areContactsWritable()) {
-                RawContactModifier.ensureKindExists(kindSectionData.getRawContactDelta(),
-                        kindSectionData.getAccountType(),
-                        ContactsContract.CommonDataKinds.StructuredName.CONTENT_ITEM_TYPE);
                 vlog(mimeType + ": falling back to first kind section data to write");
-                return new Pair<>(kindSectionData, kindSectionData.getValuesDeltas().get(0));
+                RawContactModifier.ensureKindExists(kindSectionData.getRawContactDelta(),
+                        kindSectionData.getAccountType(), mimeType);
+                if (kindSectionData.getValuesDeltas() != null &&
+                        !kindSectionData.getValuesDeltas().isEmpty()) {
+                    return new Pair<>(kindSectionData, kindSectionData.getValuesDeltas().get(0));
+                }
             }
         }