diff options
author | Zheng Fu <zhengfu@google.com> | 2015-04-24 15:25:33 -0700 |
---|---|---|
committer | Zheng Fu <zhengfu@google.com> | 2015-04-24 16:22:48 -0700 |
commit | 74e4f99cada94d6ca6be5d1bfee9abe7c4561253 (patch) | |
tree | bc10bad12b2a9d5ef9e4872cab98932f8f58696d /src/com/android | |
parent | 57e16b057e5d1fbb2383ddbe7700f2e6c9bc0a33 (diff) | |
download | packages_providers_ContactsProvider-74e4f99cada94d6ca6be5d1bfee9abe7c4561253.zip packages_providers_ContactsProvider-74e4f99cada94d6ca6be5d1bfee9abe7c4561253.tar.gz packages_providers_ContactsProvider-74e4f99cada94d6ca6be5d1bfee9abe7c4561253.tar.bz2 |
Fix some set concurrency issues in new aggregator.
Bug:19908937
Change-Id: Iade51905c1e5a1810b709d7b533984ceb6254939
Diffstat (limited to 'src/com/android')
-rw-r--r-- | src/com/android/providers/contacts/aggregation/AbstractContactAggregator.java | 3 | ||||
-rw-r--r-- | src/com/android/providers/contacts/aggregation/ContactAggregator2.java | 6 |
2 files changed, 6 insertions, 3 deletions
diff --git a/src/com/android/providers/contacts/aggregation/AbstractContactAggregator.java b/src/com/android/providers/contacts/aggregation/AbstractContactAggregator.java index 6948f23..dd0e5aa 100644 --- a/src/com/android/providers/contacts/aggregation/AbstractContactAggregator.java +++ b/src/com/android/providers/contacts/aggregation/AbstractContactAggregator.java @@ -1021,7 +1021,8 @@ public abstract class AbstractContactAggregator { + " AND " + RawContacts.CONTACT_ID + " IN " + Tables.DEFAULT_DIRECTORY; final String[] COLUMNS = new String[] { - RawContacts._ID, RawContacts.CONTACT_ID, RawContactsColumns.ACCOUNT_ID + RawContactsColumns.CONCRETE_ID, RawContacts.CONTACT_ID, + RawContactsColumns.ACCOUNT_ID }; int RAW_CONTACT_ID = 0; diff --git a/src/com/android/providers/contacts/aggregation/ContactAggregator2.java b/src/com/android/providers/contacts/aggregation/ContactAggregator2.java index ce54bec..d048609 100644 --- a/src/com/android/providers/contacts/aggregation/ContactAggregator2.java +++ b/src/com/android/providers/contacts/aggregation/ContactAggregator2.java @@ -228,7 +228,8 @@ public class ContactAggregator2 extends AbstractContactAggregator { final RawContactMatchingCandidates matchingCandidates = new RawContactMatchingCandidates( matcher.pickBestMatches(SCORE_THRESHOLD_SUGGEST)); - Set<Long> newIds = matchingCandidates.getRawContactIdSet(); + Set<Long> newIds = new HashSet<>(); + newIds.addAll(matchingCandidates.getRawContactIdSet()); // Keep doing the following until no new raw contact candidate is found. // TODO: may need to cache the matching score to improve performance. while (!newIds.isEmpty()) { @@ -246,7 +247,8 @@ public class ContactAggregator2 extends AbstractContactAggregator { } } } - newIds = tmpIdSet; + newIds.clear(); + newIds.addAll(tmpIdSet); } return matchingCandidates; } |