summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard MacGregor <rmacgregor@cyngn.com>2015-10-05 17:48:16 -0700
committerRichard MacGregor <rmacgregor@cyngn.com>2016-04-07 13:34:40 -0700
commit48f6d927f72659ca05bb96c6930ca79e81eeb155 (patch)
treef41763998461e4a064e0df25d684be9b03893b88
parentf987131a9987fcd41b501c328cba22dc4c79854d (diff)
downloadpackages_providers_ContactsProvider-48f6d927f72659ca05bb96c6930ca79e81eeb155.zip
packages_providers_ContactsProvider-48f6d927f72659ca05bb96c6930ca79e81eeb155.tar.gz
packages_providers_ContactsProvider-48f6d927f72659ca05bb96c6930ca79e81eeb155.tar.bz2
Update addresBookIndexer when removing dupes
Callable contacts allowed for removing duplicates but didn't update the addressBookIndexerCountExpression to take account for the offset. Change-Id: I92a40e3adc1a0824e44224fc50d0faeca66dec48 Tickets: CD-99
-rw-r--r--src/com/android/providers/contacts/ContactsProvider2.java6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/com/android/providers/contacts/ContactsProvider2.java b/src/com/android/providers/contacts/ContactsProvider2.java
index bd7be62..86f6213 100644
--- a/src/com/android/providers/contacts/ContactsProvider2.java
+++ b/src/com/android/providers/contacts/ContactsProvider2.java
@@ -5860,6 +5860,12 @@ public class ContactsProvider2 extends AbstractContactsProvider
uri, ContactsContract.REMOVE_DUPLICATE_ENTRIES, false);
if (removeDuplicates) {
groupBy = RawContacts.CONTACT_ID;
+
+ // In this case, because we dedupe phone numbers, the address book indexer needs
+ // to take it into account too. (Otherwise headers will appear in wrong
+ // positions.)
+ // So use count(distinct CONTACT_ID) instead of count(*).
+ addressBookIndexerCountExpression = "DISTINCT " + RawContacts.CONTACT_ID;
}
break;
}