From a87f9f49c7f773d9ad0926de5017463d72938dab Mon Sep 17 00:00:00 2001 From: Zheng Fu Date: Mon, 8 Jun 2015 17:10:30 -0700 Subject: Roll out new aggregator to limited dogfooders. Bug:19908937 Change-Id: I77e09aac3c60c60882f508a637225a4dc478a2ce --- src/com/android/providers/contacts/ContactsProvider2.java | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/com/android/providers/contacts/ContactsProvider2.java b/src/com/android/providers/contacts/ContactsProvider2.java index 7e91192..71f20f5 100644 --- a/src/com/android/providers/contacts/ContactsProvider2.java +++ b/src/com/android/providers/contacts/ContactsProvider2.java @@ -276,7 +276,11 @@ public class ContactsProvider2 extends AbstractContactsProvider private static final String PREF_LOCALE = "locale"; - private static final int PROPERTY_AGGREGATION_ALGORITHM_VERSION = 4; + private static int PROPERTY_AGGREGATION_ALGORITHM_VERSION; + + private static final int AGGREGATION_ALGORITHM_OLD_VERSION = 4; + + private static final int AGGREGATION_ALGORITHM_NEW_VERSION = 5; private static final String AGGREGATE_CONTACTS = "sync.contacts.aggregate"; @@ -1601,6 +1605,11 @@ public class ContactsProvider2 extends AbstractContactsProvider int value = android.provider.Settings.Global.getInt(context.getContentResolver(), Global.NEW_CONTACT_AGGREGATOR, 0); + + // Turn on aggregation algorithm updating process if new aggregator is enabled. + PROPERTY_AGGREGATION_ALGORITHM_VERSION = (value == 0) + ? AGGREGATION_ALGORITHM_OLD_VERSION + : AGGREGATION_ALGORITHM_NEW_VERSION; mContactAggregator = (value == 0) ? new ContactAggregator(this, mContactsHelper, createPhotoPriorityResolver(context), mNameSplitter, mCommonNicknameCache) -- cgit v1.1