Merge "Import translations. DO NOT MERGE"
diff --git a/src/com/android/contacts/editor/ContactEditorFragment.java b/src/com/android/contacts/editor/ContactEditorFragment.java
index da0d91e..27c1498 100644
--- a/src/com/android/contacts/editor/ContactEditorFragment.java
+++ b/src/com/android/contacts/editor/ContactEditorFragment.java
@@ -47,6 +47,7 @@
import android.provider.ContactsContract.Groups;
import android.provider.ContactsContract.Intents;
import android.provider.ContactsContract.RawContacts;
+import android.text.TextUtils;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.Menu;
@@ -535,6 +536,7 @@
}
}
+ String displayName = null;
// Check for writable raw contacts. If there are none, then we need to create one so user
// can edit. For the user profile case, there is already an editable contact.
if (!contact.isUserProfile() && !contact.isWritableContact(mContext)) {
@@ -542,10 +544,12 @@
// This is potentially an asynchronous call and will add deltas to list.
selectAccountAndCreateContact();
+ displayName = contact.getDisplayName();
}
// This also adds deltas to list
- bindEditorsForExistingContact(contact.getDisplayName(), contact.isUserProfile(),
+ // If displayName is null at this point it is simply ignored later on by the editor.
+ bindEditorsForExistingContact(displayName, contact.isUserProfile(),
mRawContacts);
}
@@ -851,7 +855,9 @@
mRequestFocus = false;
}
nameEditor.setEditorListener(listener);
- nameEditor.setDisplayName(mDefaultDisplayName);
+ if (!TextUtils.isEmpty(mDefaultDisplayName)) {
+ nameEditor.setDisplayName(mDefaultDisplayName);
+ }
final TextFieldsEditorView phoneticNameEditor =
rawContactEditor.getPhoneticNameEditor();
@@ -1661,7 +1667,9 @@
outState.putBoolean(KEY_IS_EDIT, mIsEdit);
outState.putBoolean(KEY_NEW_CONTACT_READY, mNewContactDataReady);
outState.putBoolean(KEY_EXISTING_CONTACT_READY, mExistingContactDataReady);
- outState.putParcelableArrayList(KEY_RAW_CONTACTS, Lists.newArrayList(mRawContacts));
+ outState.putParcelableArrayList(KEY_RAW_CONTACTS,
+ mRawContacts == null ?
+ Lists.<RawContact> newArrayList() : Lists.newArrayList(mRawContacts));
super.onSaveInstanceState(outState);
}