Loading src/com/android/contacts/editor/StructuredNameEditorView.java +18 −12 Original line number Diff line number Diff line Loading @@ -212,23 +212,29 @@ public class StructuredNameEditorView extends TextFieldsEditorView { */ public String getDisplayName() { final ValuesDelta valuesDelta = getValues(); if (hasShortAndLongForms() && areOptionalFieldsVisible()) { final String displayName = valuesDelta.getDisplayName(); if (!TextUtils.isEmpty(displayName)) { return displayName; } } if (hasShortAndLongForms()) { if (areOptionalFieldsVisible()) { final Map<String, String> structuredNameMap = valuesToStructuredNameMap(valuesDelta); final String displayName = NameConverter.structuredNameToDisplayName( getContext(), structuredNameMap); if (!TextUtils.isEmpty(displayName)) { return displayName; } // The name may have been passed to the compact editor and not written to the underlying // data structure. } else { final String displayName = valuesDelta.getDisplayName(); if (!TextUtils.isEmpty(displayName)) { return displayName; } } } return valuesDelta.getDisplayName(); } @Override public boolean isEmpty() { return TextUtils.isEmpty(getDisplayName()); } @Override protected Parcelable onSaveInstanceState() { SavedState state = new SavedState(super.onSaveInstanceState()); Loading Loading
src/com/android/contacts/editor/StructuredNameEditorView.java +18 −12 Original line number Diff line number Diff line Loading @@ -212,23 +212,29 @@ public class StructuredNameEditorView extends TextFieldsEditorView { */ public String getDisplayName() { final ValuesDelta valuesDelta = getValues(); if (hasShortAndLongForms() && areOptionalFieldsVisible()) { final String displayName = valuesDelta.getDisplayName(); if (!TextUtils.isEmpty(displayName)) { return displayName; } } if (hasShortAndLongForms()) { if (areOptionalFieldsVisible()) { final Map<String, String> structuredNameMap = valuesToStructuredNameMap(valuesDelta); final String displayName = NameConverter.structuredNameToDisplayName( getContext(), structuredNameMap); if (!TextUtils.isEmpty(displayName)) { return displayName; } // The name may have been passed to the compact editor and not written to the underlying // data structure. } else { final String displayName = valuesDelta.getDisplayName(); if (!TextUtils.isEmpty(displayName)) { return displayName; } } } return valuesDelta.getDisplayName(); } @Override public boolean isEmpty() { return TextUtils.isEmpty(getDisplayName()); } @Override protected Parcelable onSaveInstanceState() { SavedState state = new SavedState(super.onSaveInstanceState()); Loading