diff options
Diffstat (limited to 'src/com/android/contacts/common/model/dataitem/RelationDataItem.java')
-rw-r--r-- | src/com/android/contacts/common/model/dataitem/RelationDataItem.java | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/com/android/contacts/common/model/dataitem/RelationDataItem.java b/src/com/android/contacts/common/model/dataitem/RelationDataItem.java index 1ba3fcfb..9e883fef 100644 --- a/src/com/android/contacts/common/model/dataitem/RelationDataItem.java +++ b/src/com/android/contacts/common/model/dataitem/RelationDataItem.java @@ -20,6 +20,7 @@ import android.content.ContentValues; import android.content.Context; import android.provider.ContactsContract; import android.provider.ContactsContract.CommonDataKinds.Relation; +import android.text.TextUtils; /** * Represents a relation data item, wrapping the columns in @@ -46,12 +47,14 @@ public class RelationDataItem extends DataItem { } final RelationDataItem that = (RelationDataItem) t; // Relations can have different types (assistant, father) but have the same name - if (!getName().equals(that.getName())) { + if (!TextUtils.equals(getName(), that.getName())) { return false; + } else if (!hasKindTypeColumn(mKind) || !that.hasKindTypeColumn(that.getDataKind())) { + return hasKindTypeColumn(mKind) == that.hasKindTypeColumn(that.getDataKind()); } else if (getKindTypeColumn(mKind) != that.getKindTypeColumn(that.getDataKind())) { return false; } else if (getKindTypeColumn(mKind) == Relation.TYPE_CUSTOM && - !getLabel().equals(that.getLabel())) { + !TextUtils.equals(getLabel(), that.getLabel())) { // Check if custom types are not the same return false; } |