Merge "Fix bug for exchange account editor." into ub-contactsdialer-a-dev am: 5835795b48
am: 8d6d434d7c

* commit '8d6d434d7cbf819786878d8c6f5965ef5b99f119':
  Fix bug for exchange account editor.
diff --git a/src/com/android/contacts/editor/StructuredNameEditorView.java b/src/com/android/contacts/editor/StructuredNameEditorView.java
index 23cb4c1..1a9c693 100644
--- a/src/com/android/contacts/editor/StructuredNameEditorView.java
+++ b/src/com/android/contacts/editor/StructuredNameEditorView.java
@@ -221,8 +221,13 @@
      */
     public void setDisplayName(String name) {
         // For now, assume the first text field is the name.
-        // TODO: Find a better way to get a hold of the name field.
+        // TODO: Find a better way to get a hold of the name field,
+        // including given_name and family_name.
         super.setValue(0, name);
+        getValues().setDisplayName(name);
+        rebuildStructuredName(getValues());
+        super.setValue(1, getValues().getAsString(StructuredName.GIVEN_NAME));
+        super.setValue(3, getValues().getAsString(StructuredName.FAMILY_NAME));
     }
 
     /**
@@ -230,6 +235,7 @@
      */
     public String getDisplayName() {
         final ValuesDelta valuesDelta = getValues();
+        rebuildFullName(valuesDelta);
         if (hasShortAndLongForms() && areOptionalFieldsVisible()) {
             final Map<String, String> structuredNameMap = valuesToStructuredNameMap(valuesDelta);
             final String displayName = NameConverter.structuredNameToDisplayName(