diff options
-rw-r--r-- | src/com/android/providers/contacts/aggregation/AbstractContactAggregator.java | 47 |
1 files changed, 24 insertions, 23 deletions
diff --git a/src/com/android/providers/contacts/aggregation/AbstractContactAggregator.java b/src/com/android/providers/contacts/aggregation/AbstractContactAggregator.java index 5895f51..1fb6381 100644 --- a/src/com/android/providers/contacts/aggregation/AbstractContactAggregator.java +++ b/src/com/android/providers/contacts/aggregation/AbstractContactAggregator.java @@ -16,28 +16,6 @@ package com.android.providers.contacts.aggregation; -import android.database.Cursor; -import android.database.DatabaseUtils; -import android.database.sqlite.SQLiteDatabase; -import android.database.sqlite.SQLiteQueryBuilder; -import android.database.sqlite.SQLiteStatement; -import android.net.Uri; -import android.provider.ContactsContract.AggregationExceptions; -import android.provider.ContactsContract.CommonDataKinds.Email; -import android.provider.ContactsContract.CommonDataKinds.Identity; -import android.provider.ContactsContract.CommonDataKinds.Phone; -import android.provider.ContactsContract.CommonDataKinds.Photo; -import android.provider.ContactsContract.Contacts; -import android.provider.ContactsContract.Data; -import android.provider.ContactsContract.DisplayNameSources; -import android.provider.ContactsContract.FullNameStyle; -import android.provider.ContactsContract.PhotoFiles; -import android.provider.ContactsContract.PinnedPositions; -import android.provider.ContactsContract.RawContacts; -import android.provider.ContactsContract.StatusUpdates; -import android.text.TextUtils; -import android.util.EventLog; -import android.util.Log; import com.android.internal.annotations.VisibleForTesting; import com.android.providers.contacts.ContactLookupKey; import com.android.providers.contacts.ContactsDatabaseHelper; @@ -69,6 +47,29 @@ import com.google.android.collect.Maps; import com.google.common.collect.HashMultimap; import com.google.common.collect.Multimap; +import android.database.Cursor; +import android.database.DatabaseUtils; +import android.database.sqlite.SQLiteDatabase; +import android.database.sqlite.SQLiteQueryBuilder; +import android.database.sqlite.SQLiteStatement; +import android.net.Uri; +import android.provider.ContactsContract.AggregationExceptions; +import android.provider.ContactsContract.CommonDataKinds.Email; +import android.provider.ContactsContract.CommonDataKinds.Identity; +import android.provider.ContactsContract.CommonDataKinds.Phone; +import android.provider.ContactsContract.CommonDataKinds.Photo; +import android.provider.ContactsContract.Contacts; +import android.provider.ContactsContract.Data; +import android.provider.ContactsContract.DisplayNameSources; +import android.provider.ContactsContract.FullNameStyle; +import android.provider.ContactsContract.PhotoFiles; +import android.provider.ContactsContract.PinnedPositions; +import android.provider.ContactsContract.RawContacts; +import android.provider.ContactsContract.StatusUpdates; +import android.text.TextUtils; +import android.util.EventLog; +import android.util.Log; + import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; @@ -1931,7 +1932,7 @@ public abstract class AbstractContactAggregator { Set<Long> contactIds = new HashSet<>(); for (MatchScore bestMatch : bestMatches) { long cid = bestMatch.getContactId(); - if (!contactIds.contains(cid)) { + if (!contactIds.contains(cid) && cid != contactId) { bestMatchesWithoutDuplicateContactIds.add(bestMatch); contactIds.add(cid); } |