Add name to rawContactDelta when editing a Me contact.
This cl will fix Me profile editor by showing its name field.
BUG 25159510
Change-Id: Ifd29528c3a9c0f017af3532a50f3b1f00d953969
diff --git a/src/com/android/contacts/editor/KindSectionDataList.java b/src/com/android/contacts/editor/KindSectionDataList.java
index 6374740..7a7dec2 100644
--- a/src/com/android/contacts/editor/KindSectionDataList.java
+++ b/src/com/android/contacts/editor/KindSectionDataList.java
@@ -19,7 +19,9 @@
import com.android.contacts.common.model.ValuesDelta;
import com.android.contacts.common.model.account.AccountWithDataSet;
import com.android.contacts.common.model.dataitem.DataKind;
+import com.android.contacts.common.model.RawContactModifier;
+import android.provider.ContactsContract;
import android.util.Log;
import android.util.Pair;
@@ -102,8 +104,10 @@
// Just return the first writable entry.
for (KindSectionData kindSectionData : this) {
- if (kindSectionData.getAccountType().areContactsWritable()
- && !kindSectionData.getValuesDeltas().isEmpty()) {
+ 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));
}