summaryrefslogtreecommitdiff
path: root/java/com/android/dialer/phonelookup/composite
AgeCommit message (Collapse)Author
2018-01-11Fixed bug in handling of empty numbers in new call log.zachh
Empty numbers were not being inserted into PhoneLookupHistory because the URI "content://.../PhoneLookupHistory/" is treated the same as "content://.../PhoneLookupHistory" (w/o the trailing slash). This caused the update (i.e. replace) operation to incorrectly update all rows in the table when it should have updated a single row. The fix for this was to switch to a query parameter, so the empty number URI now looks like "content://.../PhoneLookupHistory?number=" Also improved some logging while debugging this problem. Bug: 71866050 Test: unit and manual PiperOrigin-RevId: 181659081 Change-Id: Idec4fb77e74920cd5485620b0a997db03aa8ff9b
2018-01-05Implement dialer blocked number phone lookuptwyen
This CL implements looking up the dialer internal database for blocked numbers when the system database is not available yet. Data is only invalidated when dialer is alive since that is the only time blocked numbers can be set and removed. Bug: 70989538,70989547 Test: DialerBlockedNumberPhoneLookupTest PiperOrigin-RevId: 180956355 Change-Id: Ie7acf091bf58a074d0a1ee39613fad035d2e6e60
2017-12-27Parameterized PhoneLookup with submessage type.zachh
This allows indvidual PhoneLookups to define and deal mostly with their own submessage type (with the exception of trivial setter and getter methods for converting from/to PhoneLookupInfo). This also simplifies the FakePhoneLookup and tests which use it a bit, I think. Bug: 34672501 Test: unit PiperOrigin-RevId: 179976215 Change-Id: I2db1fc85771621be2f2afcd6af114d82680e30d0
2017-12-22Added copySubMessage method to PhoneLookup interface.zachh
The existing way that protos are merged in CompositePhoneLookup is not correct because foo_submessage from BarDataSource may incorrectly contribute old information to the merged message. The new copySubMessage method makes it so that each PhoneLookup is responsible for defining which submessage it is responsible for and prevents the problem. Test: unit PiperOrigin-RevId: 179707015 Change-Id: I566305cf64c46c698f14812d9241d166ac75a6d3
2017-12-07Renamed PhoneLookup#bulkUpdate to #getMostRecentPhoneLookupInfo.zachh
This is just to more clearly convey what the method does. Bug: 34672501 Test: existing PiperOrigin-RevId: 178188575 Change-Id: Id02f34b1d79346ecd8ca9eebc043fe9b3063264b
2017-12-07Added bindings for ListeningExecutorServices.zachh
Use them where appropriate. Bug: 34672501 Test: existing PiperOrigin-RevId: 178182298 Change-Id: If454225e0d636c7cb14b5af02d46780d7732abf0
2017-12-07Added PhoneLookupSelector.zachh
This class is responsible for prioritizing and selecting data from a PhoneLookupInfo object, which contains information from many phone lookup sources. Bug: 34672501 Test: unit PiperOrigin-RevId: 177893924 Change-Id: Ib98a4656fe87141162a7ac53af4a0ad421196046
2017-12-07Removed timestamps from PhoneLookup APIs.zachh
Also added onSuccessfulBulkUpdate method. It is safer for each PhoneLookup to keep track of its own last processed time via shared prefs where the value saved is the actual last processed timestamp from the underlying data. This is because it is difficult or impossible to select a single time that spans lookups due to queries being run and processed at different times. The onSuccessfulBulkUpdate method is provided as a hook for PhoneLookups to persist their shared pref once they know the result of bulkUpdate have been successfully saved. Finally, removed usage of the lastModified timestamp from PhoneLookupHistory in PhoneLookupDataSource since I believe the cases it was originally intended to cover are now handled by populateInserts(). Bug: 34672501 Test: unit PiperOrigin-RevId: 177891586 Change-Id: I072409fc217e4d7e36816548862e8b358aebf165
2017-11-11Use lambdas in CompositePhoneLookup.zachh
They should work now that we target guava 20 instead of 18 in AOSP. Test: tap PiperOrigin-RevId: 175354039 Change-Id: Id7844c3a1c8e29e5ecb13fa36a92dd80be0cfc7c
2017-11-11Implemented CompositePhoneLookup#bulkUpdate.zachh
Bug: 34672501 Test: unit PiperOrigin-RevId: 174532642 Change-Id: I0115fb26f99fe764bc90625e3ed51f3c4c99439d
2017-11-10Implemented CompositePhoneLookup#isDirty.zachh
IsDirty is implemented by (possibly in parallel) executing all child lookups, and completing as soon as the first lookup reports itself as dirty, cancelling other lookups upon completion. If a lookup fails for some reason, it is treated as not being dirty. This required adding a new method DialerFutures#firstMatching. Bug: 34672501 Test: yes PiperOrigin-RevId: 174261470 Change-Id: Icb4f7b5d9926094fc446542411d15d02a4b873a3
2017-11-10Fixed AOSP breakage due to incompatible guava api.zachh
Test: none PiperOrigin-RevId: 174258291 Change-Id: Idf4eb0096fef383bd5f3544fdedba03528d14f41
2017-11-10Set the ceiling at O.erfanian
Test: no PiperOrigin-RevId: 174239092 Change-Id: I6672c5b0a41df6426b527d1565f0cb216dc82917
2017-11-01Added CompositePhoneLookup and added and implemented "lookup" method.Zachary Heidepriem
Fleshed out docs for PhoneLookup. Added dagger components and modules. Bug: 34672501 Test: unit PiperOrigin-RevId: 173977963 Change-Id: If07795d9d3d56a59afd27cdda3e98543bf30fdb8