summaryrefslogtreecommitdiffstats
path: root/src/com/android/providers/contacts/aggregation
Commit message (Collapse)AuthorAgeFilesLines
* Contacts: automatic merge count metricsErica Chang2016-04-071-0/+11
| | | | | | CD-297 Change-Id: I08250503463b9fa3cedd2f800b20c298cc1b0786
* Don't show aggregation suggestions for contacts itself.Zheng Fu2015-07-301-23/+24
| | | | | Bug:22224442 Change-Id: I82a52daef157b0280329402a90fd9a8becd60034
* Fix failing tests due to logic changes in the new aggregator.Zheng Fu2015-07-172-3/+1
| | | | | | | | | | 1. All the raw contacts with same name and no data will group together, so we need to assign different names in this test. 2. We don't have split step anymore, so there is no unpin operation. 3. Fix Long comparison in the aggregator. Bug:22566083 Change-Id: I1a963bf17866e7569012e4cceca034e7c8312aa3
* Performance turning for aggregatorZheng Fu2015-07-152-66/+97
| | | | | | | | | | | | | | 1. Move identification matching to secondary 2. In the first stage, do secondary matching only if there is no structured name 3. Aggregate all the raw contacts without structured name if they have matching secondary data 4. Remove approximate name matching in aggregator. (This will not impact the name variant, such as John and Johathan matching) Bug:22200630 Bug:21931859 Change-Id: I295e283dbe1929e20b80272027df226c01bc2f74
* Dealing with some edge cases with soft deleted contacts.Zheng Fu2015-07-101-1/+2
| | | | | | | | | 1. Exlude soft deleted contacts for aggregator algorithm upgrade. 2. Make sure to update the contacts.name_raw_contact_id column for soft deleted raw contact. Bug:22378846 Change-Id: I53a48ced645f9b00b708b4b9d88518a529834f89
* Fix bug in aggregation suggestions in new contacts aggregator.Zheng Fu2015-07-071-1/+11
| | | | | | | | | New contact aggregator is using rawContactsMatcher, which is keyed by rawContactId instead of contactId. So we need to remove bestMatches with duplicate contactId for calculating the aggregation suggestions. Bug:22224442 Change-Id: I9e77400a5b09ec28d5bc120706cd4dfe2e296d56
* code refactor in ContactAggregatorHelperZheng Fu2015-06-191-1/+1
| | | | | Bug:19908937 Change-Id: I554bae7a76173419717f9ce46aa778b8e5bc5807
* Performance tuning for contact aggregator2Zheng Fu2015-06-024-94/+171
| | | | | | | | | | 1. Skip already aggregated raw contacts during aggregation algorithm upgrade. 2. Remove case conversion during email comparion for better performance. 3. Fix bugs in the ContactAggregatorHelper to fix the flaky unit test. Bug:21466686 Bug:19908937 Change-Id: I6f59894a4fdc605fe1b92ac82e2ac9e90561a158
* Fix invalidateAggregationExceptionCache().Makoto Onuki2015-05-273-88/+45
| | | | | | | | | Also clean up aggregator in preparation in preparation for b/19482664 Two tests in ContactAggregator2Test are failing, but it's irrelevant to this change. (Bug filed for this.) Change-Id: Id630812335fdaa2ab4955c240700b82fed84d1a8
* Fix bugs in aggregator2.Zheng Fu2015-05-212-24/+123
| | | | | | | | | | | | | 0. Add unit test for aggregator2. 1. Only aggregate raw contacts in the default directory 2. Remove aggregation exception matches from the aggregation suggestion list 3. Fix the sqls to clear primary settings when merging 4. Make the scoring system consistent with current aggregator. 5. Don't aggregate raw contacts without name to any other raw contacts even when data matching exist. Bug: 19908937 Change-Id: Ie580def5ee9e3a291cd5bf112ccb29627f9b67cc
* Fix some set concurrency issues in new aggregator.Zheng Fu2015-04-242-3/+6
| | | | | Bug:19908937 Change-Id: Iade51905c1e5a1810b709d7b533984ceb6254939
* use new setting flag to switch between current and new aggregator.Zheng Fu2015-04-157-4797/+389
| | | | | | | | In order for the switch, add AbstractContactAggregator for ContactAggregator and ContactAggregator2. Bug:20055573 Change-Id: I6f27d4df8017938b226f5c6371b15ba41fd18acd
* Fork ContactAggregator to AbstractContactAggregator to keep file hsitory.Zheng Fu2015-04-151-0/+2805
| | | | | Bug:20055573 Change-Id: I42c85df36f039b59707101660441243fb90baca2
* Add some new method implementations for new contact aggregator.Zheng Fu2015-04-023-92/+173
| | | | | | | | Also add a ContactAggregatorHelper class to hold some helper methods to better falicitate unit testing Bug:19908937 Change-Id: I2e2bcef2228e7a171e9c3259c27c3fa28bde646c
* New contact aggregator (part 1)Zheng Fu2015-03-303-531/+456
| | | | | | | | | | | | | | | | | | | | | | | | | Summary of the changes are: 1. In RawContactMatcher, add rawContactId and accountId to MatchScore inner class, so that match score is on raw contacts level instead] of accumulate to contact level 2. Add a wrapper RawContactMatchingCandidates to MatchScore to facilitate the aggregation. 3. In ContactAggregator2, add findRawContactMatchingCandidates() method to find the set of matching raw contacts for a given raw_contact_id. This method will use the logic of updateMatchScoresForSuggestionsBasedOnDataMatches() so that it will give a set of raw contacts candidate with matching score above threshold. 4. The second stage "Pair-wise comparison and find the connected component of all the raw contacts in RawContactMatchingCandidates" is done in new method reAggregateRawContacts(); 5. Some new methods still throw unSupportedOperationExceptions, and they will be implemented in part2. 6. Tests will be implemented in follow-up cls. Bug:19908937 Change-Id: I53483a29c24401e2f38a727168e7431cef86370a
* Fork ContactMatcher.java to RawContactMatcher.javaZheng Fu2015-03-181-0/+456
| | | | | | This is to copy the file history for new raw contact matcher. Change-Id: I28f9e36d743268e2c17970175c09ba4d9aed86cd
* Fork ContactAggregator.java to ContactAggregator2.javaZheng Fu2015-02-261-0/+2834
| | | | | | This is to copy the file history for new aggregator. Change-Id: I57994a3c1ed0eaeaffa45bf921b2e17dbcf702d3
* Remove NAME_VERIFIED. Part3Brian Attwell2015-01-301-32/+49
| | | | | | | | | | | Support use of IS_SUPER_PRIMARY instead of NAME_VERIFIED. The contact aggregator now pays attention to IS_SUPER_PRIMARY. Remove all references to NAME_VERIFIED from CP2. Bug: 18777272 Change-Id: I1579a3122b2d45b80de7106a2b9616e323855045
* Additional change to IS_SUPER_PRIMARYBrian Attwell2015-01-281-5/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | UPDATE ----------------- This is being committed a second time, with two small changes from ag/619454: 1. This CL can be directly cherry-picked to MR1 because of the simpler unit test 2. Don't run a pointless update() call Original CL Comment ------------------ Noticed clearSuperPrimarySetting() sometimes clears all mimetypes's is_super_primary flag values sometimes, even mimetypes that aren't contained in both raw contacts. This doesn't appear to have been the intended behavior. Looks like a simple bug. Wrote a unit test and fixed the bug. Added a new method to DataUtil used inside the unit test. This method wasn't strictly necessary. But it is very useful in later CLs. (Part #2 or "Remove NAME_VERIFIED" series of CLs) Bug: 5080996 Bug: 18777272 Change-Id: I7944aae2ad4acb4df6560c5cd086242b7582fbf5
* Revert "Additional change to IS_SUPER_PRIMARY"Brian Attwell2015-01-281-2/+5
| | | | | | This reverts commit c44ee526c56d2f5e680cef24897cff3a922d6a2f. Change-Id: I2d81fb028eb0672db9cc291ac187c2629435969d
* Additional change to IS_SUPER_PRIMARYBrian Attwell2015-01-281-5/+2
| | | | | | | | | | | | | | | | | | Noticed clearSuperPrimarySetting() sometimes clears all mimetypes's is_super_primary flag values sometimes, even mimetypes that aren't contained in both raw contacts. This doesn't appear to have been the intended behavior. Looks like a simple bug. Wrote a unit test and fixed the bug. Added a new method to DataUtil used inside the unit test. This method wasn't strictly necessary. But it is very useful in later CLs. (Part #2 or "Remove NAME_VERIFIED" series of CLs) Bug: 5080996 Bug: 18777272 Change-Id: I354ffe51ea64cc532387d7ba79fbb6d2389d662e
* Change IS_SUPER_PRIMARY reset logicBrian Attwell2015-01-261-6/+8
| | | | | | | | | | | | | | | | | | | | | CHANGES 1) change is_super_primary reset as discussed in go/proposed-change-to-resetting-super-primary-on-join 2) fix a bug in case #1 of testAggregation_clearSuperPrimary and extended the case a bit. Previously, both data rows had is_super_primary=false at setup instead of both true REASON This is mostly for the benefit of Lychee and future contact editor changes. This CL was also needed to make removing use of NAME_VERIFIED from GoogleContacts possible. At the very least, IS_SUPER_PRIMARY's behavior is now more consistent with NAME_VERIFIED. Bug: 5080996 Bug: 18777272 Change-Id: Ic3c17fcb1757f5966a7c6a52cf489083d5b8e51a
* Skip aggregation if candidate contact contains too many raw contactsZheng Fu2014-12-091-2/+19
| | | | | | | This is likely an error or a shared corporate data element Bug:18641722 Change-Id: Icab78bcf621363a5b887095c043e2e1e3a2e1ca4
* Modify the contact split logic to avoid over-split issue.Zheng Fu2014-11-131-171/+365
| | | | | | | | | | | | | | | | | | | | | Details If the best matching contact doesn't contain any raw contacts from the same account as the given raw contact, join them together if no identity mismatch between them on the same namespace, otherwise, keep them separate. If the best matching contact contains raw contacts from the same account as the given raw contact, join them together if they share at least one email address, phone number, or identity; otherwise, re-aggregate raw contact and all the raw contacts of best matching contact. When re-aggregation is needed, re-aggregate all the raw contacts (given raw contacts plus all the raw contacts of the best matching contact) based on the pair-wise connectivity. Two raw contacts are considered connected if they share at least one email address, phone number or identity. Bug:18304324 Change-Id: Ic5a27a23c2f64f534f7a7eaf5f3fb474e877c207
* Make the email comparison case-insensitive for contact aggregation.Zheng Fu2014-11-131-2/+2
| | | | | Bug:18304324 Change-Id: If9e11022e392323b770c7560eba69617769ca080
* DO NOT MERGE Remove default settings during contacts aggregation.Zheng Fu2014-09-151-0/+53
| | | | | | | | | Set is_super_primary to 0 for all the shared mime-types's data between aggregated contacts. Bug:5080996 Change-Id: Ie65259c11d719b343f234e5fccf883491e7992a7 (cherry picked from commit 96ddeddc52c85710a10cd8266c054ff1b1c5a52b)
* Fix broken aggregation behavior for pinned contacts and testsYorke Lee2014-07-301-4/+9
| | | | | | | | | | Update the value of some pre-defined constants in tests Make sure that aggregation correctly sets pinned positions for aggregated contacts - the lowest pinned position of all constituent raw contacts, and 0 if none of them are pinned. Bug: 16628573 Change-Id: I3e072baf7ff933a6eef861ed394f3fc817aee48b
* Handle DEMOTE and UNDEMOTE in CP2Yorke Lee2013-08-051-4/+6
| | | | | | | | | | | * If a contact is UNDEMOTED, if it was previously DEMOTED, it will become UNPINNED. Otherwise, it will remain unchanged. * When two raw contacts are aggregated, the parent contact should inherit the lower pinned position of the two, not including negative integers. Change-Id: I74f41dfa327b8e5a79688b1e99eafbef7d9d58a0
* Add pinning support in ContactsProviderYorke Lee2013-07-241-11/+59
| | | | Change-Id: I3c835c2fd0faf99f8fb176752cfcb12e011095a2
* Adding contacts delta api.Chiao Cheng2013-04-081-11/+14
| | | | | | | | | | Updates and inserts can be detected through the use of a new timestamp field in the contacts table. Deletes can be detected by querying the new deleted_contacts table. Bug: 8182147 Change-Id: I5c1e596f4e1aa58528afc29396f79cb4051e229c
* am d109b237: am ff91ec35: Tolerate crashes during re-aggregation.Makoto Onuki2012-07-201-2/+13
|\ | | | | | | | | * commit 'd109b23736e4171d23356642bd5dbe28743341da': Tolerate crashes during re-aggregation.
| * am ff91ec35: Tolerate crashes during re-aggregation.Makoto Onuki2012-07-191-2/+13
| |\ | | | | | | | | | | | | * commit 'ff91ec356f1b17dea095a880f61b8bc4ff333b1e': Tolerate crashes during re-aggregation.
| | * Tolerate crashes during re-aggregation.Makoto Onuki2012-07-181-2/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This CL consists of two parts: - Don't crash even if the name_lookup table contains malformed data. Just treat it as name-unmatch. - Don't crash even if an exception is thrown durign re-aggregation. Re-aggregation is not *that* important anyway, so in that case just bump the logic version and start the provider normally. (And even if we fail to bump the version number, just go ahead and continue.) Bug 6827136 Change-Id: Ifa3d4697c5d81f3480e0b8a9238b49312ac75e3b
* | | Reorganize import in contacts providerMakoto Onuki2012-06-273-27/+27
|/ / | | | | | | Change-Id: If3afb134ea36bd93859efcd114885526e1592b91
* | am a499a2ad: Merge "Fix aggregation exception problem"Makoto Onuki2012-06-131-0/+4
|/ | | | | * commit 'a499a2adb856223de65d298cd93d70c85afe3d4d': Fix aggregation exception problem
* Don't suggest invisible for aggregationMakoto Onuki2012-04-251-2/+3
| | | | | | Bug 6400450 Change-Id: I4b5ed4a331f6740c3954b232633076e60e1de140
* Merge "New aggregation logic"Makoto Onuki2012-04-232-56/+244
|\
| * New aggregation logicMakoto Onuki2012-04-202-56/+244
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Now a raw contact can be merged into a contact containing raw contacts from the same account if there's at least one raw contact in those raw contacts that shares at least one email address, phone number, or identity. Now the aggregation logic version is 3. Also: - Make sure changes to the identity triggers aggregation. - Stop re-using some HashMaps/HashSets, as they don't shirink the internal table when clear()ed. During the aggregation update we may put a bunch of stuff into those, and we want to make sure that we don't keep unnecessarily bit internal tables after the upgrade. This should be okay with the modern dalvik GC. Change-Id: I855085d334679363cf9bffb918ca2ceb0cfe77f5
* | Fix most of photo testsMakoto Onuki2012-04-121-1/+1
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | Adjusting existing unit tests for higher res photos turned out to be tricky, because the size of the test images were selected for 256x256. (e.g. cropping tests) Also we don't want the display photo size to change depending on the running device. So let's just keep using 256x256 for all unit tests. Added new asserts to EvenMoreAssert to compare image raw data, which prints actual/expected dimensions when it fails. Even with this CL, ContactsProvider2Test.testInputStreamForPhoto() still fails with the following assert message. The image size seems to be correct, so I'm not sure why. This may be because we've changed the compression rate, but I didn't dig into it. "Different data lengths: expected=1088 actual=1578, expected dimentions=[96 x 96] actual dimentions=[96 x 96]" Anyway, with this CL at least PhotoStoreTest will no longer crash, so let's merge it now and take care of the failing test later. Change-Id: I935f76acee3c2de99030c62e14f43de07074fb8a
* Add new package aggregation.utilMakoto Onuki2012-03-235-4/+765
| | | | | | Move aggregator related classes into it. Change-Id: I712fe07ad2bab1e532e3822e3e2797a199329865
* Move aggregator to its own packageMakoto Onuki2012-03-052-0/+2398
... so that methods used only by ProfileAggregator don't have to be public. And fix some method visibilities that don't make sense. Needed to change the bogus ID in PhotoStoreTest; otherwise moving the aggregator test will make this test fail for some unclear reason. Bug 6118852 Change-Id: Ic0c022cbf50128f40c70559c1a7cf8e2a6c06fc8