fixing duplicate system-contacts

Fixes #4029
Closes #4072
This commit is contained in:
Matthias Voppichler 2015-09-14 23:40:13 +02:00 committed by Moxie Marlinspike
parent 6ba95446ec
commit cbcd53a8a0

View File

@ -175,6 +175,10 @@ public class ContactsDatabase {
uri = ContactsContract.CommonDataKinds.Phone.CONTENT_URI;
}
if (android.os.Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
uri = uri.buildUpon().appendQueryParameter(ContactsContract.REMOVE_DUPLICATE_ENTRIES, "true").build();
}
String[] projection = new String[]{ContactsContract.CommonDataKinds.Phone._ID,
ContactsContract.CommonDataKinds.Phone.DISPLAY_NAME,
ContactsContract.CommonDataKinds.Phone.NUMBER,