Age | Commit message (Collapse) | Author |
|
Bug: 70989631
Test: PeopleApiPhoneLookupTest, Cp2ExtendedDirectoryPhoneLookupTest
PiperOrigin-RevId: 199365461
Change-Id: I017cca8bdb469236ac60382e5fbe7f55976a12b9
|
|
Before, when tapping the icon in the call log for a call made to a remote contact, I would get a "Contact doesn't exist" message because CP2 couldn't find the contact due to:
05-18 22:28:48.750 E/DatabaseUtils(26187): java.lang.IllegalArgumentException: Invalid lookup id: people-v2:114584120460114609902
05-18 22:28:48.750 E/DatabaseUtils(26187): at com.android.providers.contacts.ContactLookupKey.parse(ContactLookupKey.java:157)
05-18 22:28:48.750 E/DatabaseUtils(26187): at com.android.providers.contacts.ContactsProvider2.lookupContactIdByLookupKey(ContactsProvider2.java:7766)
05-18 22:28:48.750 E/DatabaseUtils(26187): at com.android.providers.contacts.ContactsProvider2.queryLocal(ContactsProvider2.java:6248)
05-18 22:28:48.750 E/DatabaseUtils(26187): at com.android.providers.contacts.ContactsProvider2.queryDirectoryIfNecessary(ContactsProvider2.java:5565)
05-18 22:28:48.750 E/DatabaseUtils(26187): at com.android.providers.contacts.ContactsProvider2.query(ContactsProvider2.java:5544)
05-18 22:28:48.750 E/DatabaseUtils(26187): at android.content.ContentProvider.query(ContentProvider.java:1147)
05-18 22:28:48.750 E/DatabaseUtils(26187): at android.content.ContentProvider$Transport.query(ContentProvider.java:240)
05-18 22:28:48.750 E/DatabaseUtils(26187): at android.content.ContentProviderNative.onTransact(ContentProviderNative.java:102)
05-18 22:28:48.750 E/DatabaseUtils(26187): at android.os.Binder.execTransact(Binder.java:697)
When we construct the contact URI in Cp2ExtendedDirectoryPhoneLookup, we should include the directory ID so that CP2 knows where to look when the user taps the icon in the call log.
TEST=unit, manual
Bug: 80008014
Test: unit, manual
PiperOrigin-RevId: 197600727
Change-Id: Ib262ca4b7e605c3e94ea683289f62c727389b32f
|
|
When the user disables contacts permisssions, instead of crashing, we need to clear all CP2 data from the annotated call log.
When updating tests to use the dagger processor there were some other dependencies and tests that needed to be cleaned up a bit.
TEST=unit
Bug: 72461366
Test: unit
PiperOrigin-RevId: 196318115
Change-Id: I95ff952f1e4492bebe364571ff70b2483c894ead
|
|
Use it when logging performance metrics.
Unfortunately the class names returned by Class#getSimpleName() are obfuscated by proguard and make viewing the metrics difficult to impossible.
TEST=none
Test: none
PiperOrigin-RevId: 195749831
Change-Id: I40320f388d34e059c9a913e2b72a1acf1a727f60
|
|
Bug: 70988687
Test: Cp2DefaultDirectoryPhoneLookupTest, PhoneLookupInfoConsolidatorTest
PiperOrigin-RevId: 192085574
Change-Id: I4512c9e2e9e14340fa3aa9b2d7d6aaea6344bba6
|
|
Also use a flag to control the threshold at which we process invalid numbers.
Bug: 70989667
Test: unit
PiperOrigin-RevId: 191095892
Change-Id: Idb424831d637ae44e5e5915afaf59c3d534ce4a0
|
|
up to N.
Test: Existing tests
PiperOrigin-RevId: 190508397
Change-Id: Ia5f33e45af1d1cc666fec5f43efa564b2b68c193
|
|
Impls can access appContext via dagger.
Test: existing
PiperOrigin-RevId: 189974157
Change-Id: Ie64d2c6f9ba08fc914d3c31f7e014c2beef3ab00
|
|
This is necessary to disable the call log framework via flags.
This isn't yet called anywhere.
Bug: 74821995
Test: unit
PiperOrigin-RevId: 189838957
Change-Id: I926c02c41151528eabc208c874acbfe7897a2f93
|
|
This is needed to support flag changes which should cause the call log framework to become disabled.
It's not called anywhere yet.
Bug: 74821995
Test: unit
PiperOrigin-RevId: 189761665
Change-Id: I914c690448f03ebacd7d05c9ad082aba7bf1a4ce
|
|
Bug: 73887387
Test: Existing tests
PiperOrigin-RevId: 187225355
Change-Id: I65de553078e147a46d933daf34dfd912fc8aa74c
|
|
Bug: 73547944
Test: Cp2ExtendedDirectoryPhoneLookupTest
PiperOrigin-RevId: 187064655
Change-Id: Icb468e0867248f097a77134dd67a53352f7c80b0
|
|
Bug: 73347270
Test: Existing tests + RefreshAnnotatedCallLogNotifierTest
PiperOrigin-RevId: 186347066
Change-Id: I5a530416bdaa9edc7131a0d5ced44f1b5ee1692b
|
|
Bug: 73007132
Test: NumberAttributesConverterTest, PhoneLookupInfoConsolidatorTest
PiperOrigin-RevId: 185545712
Change-Id: I228d8c4e1b6327e38057f73aad63bb7048704d49
|
|
There will never be contact information for an empty number, so don't bother trying to look them up at render time.
This also prevents a crash in the new voicemail fragment that occurs due to an assertion that voicemail rows will never be incomplete, when it may be possible for a voicemail to exist with an empty number.
Also, don't set short numbers in VoicemailPopulator, since we don't expect this to be possible and would like to avoid crashing in the aforementioned assertion when using simulator.
Test: unit
PiperOrigin-RevId: 184615402
Change-Id: I5286112b57179e002f04de81c04475f30b3e1833
|
|
These are frequently used attributes of numbers that we can compute once at parse-time.
Also did some general cleanup of DialerPhoneNumberUtil:
-Removed unused Future version of parse()
-Remove formatToValidE164 now that the new fields are available
-Inlined normalizeNumber()
Bug: 72563861
Test: existing
PiperOrigin-RevId: 183720128
Change-Id: I702dc265360e590439c5352c493ae8a858f36812
|
|
There's a problem with the existing implementation of RealtimeRowProcessor; when CP2 information is not present, data from other sources can potentially be erased.
This CL fixes the problem by fetching the latest data from all sources, instead of just CP2. This requires being able to fetch PhoneLookup info without a Call, using only a number, so I changed PhoneLookup#lookup to accept a DialerPhoneNumber rather than a Call.
(The reason that it accepted a Call was to support CNAP so we'll need a revised solution for that later.)
There is a potential concern with performance in RealtimeRowProcessor due to performing a full [Composite]PhoneLookup vs. a CP2 lookup, because the full lookup includes network requests. However, it's anticipated that the real time lookups will very rarely have changes to apply so this might be OK as-is. If not, a mitigation strategy could be improving the performance of CompositePhoneLookup#lookup by short-circutiing slower sources when faster, higher priority sources have already completed.
A follow-up CL will write the result of RealtimeRowProcessor queries to PhoneLookupHistory to further reduce how frequently real time updates need to be applied.
Bug: 72229553
Test: existing unit
PiperOrigin-RevId: 182839130
Change-Id: I8cb26827b4f4dc4702fb416234c8938179cd5ac5
|
|
This is an optimization to reduce popping in the new call log. Currently when Cp2LocalPhoneLookup determines a number to be "incomplete" (because it is an invalid number and there are too many invalid numbers in the call log to efficiently bulk update) we clear the existing data, which has been populated in PhoneLookupHistory (for example, from InCallUi). This means that we will show the number initially when displaying the call log, and then when the query completes we will "pop in" the new information.
This change makes it so that we don't clear the existing data from PhoneLookupHistory, and just add the "incomplete" bit. The result of this is that we immediately display the available information when initially displaying the call log (even though it may be out of date). When the query completes, the row will be updated with the most recent information; in most cases this is likely to be the same as the information used to initially display the row, and no update will need to be applied.
Additoinal changes to support this functionality:
-RealtimeRowProcessor is now just responsible for returning an updated row, and NewCallLogView holder will compare the result to the originally displayed row and only update the UI if there are differences.
-NewCallLogFragment now calls clears the RealtimeRowProcessor's cache and notifies data set changed during onResume. This is to account for the fact that AnnotatedCallLog no longer contains the complete set of information necessary to show the call log; there may be changes we need to show which can't be detected by the cursor loader. We now show those potential changes in onResume.
Additional notes:
-If there is real-time data that changes after onResume it won't be detected but there shouldn't be such cases; changes made to contact information from dialer are always done through contact cards which pause the fragment.
-This change has the effect that whatever information was written to PhoneLookupHistory during the previous invocation of InCallUi will always be (initially) shown. For example, if the contact name for number "123" is "Joe" when the call comes in, we'll write "Joe" to PhoneLookupHistory. If the user changes Joe's name to "Jane", the UI will pop from "Joe" to "Jane" until PhoneLookupHistory is updated (which is currently only done from InCallUi). If this turns out to be a problem it could be mitigated by writing updated results to PhoneLookupHistory from the UI.
Test: unit, manual
PiperOrigin-RevId: 182277145
Change-Id: I3d9916b7747390ff956f399fe84b26d578e5a07f
|
|
Test: none
PiperOrigin-RevId: 181816649
Change-Id: I4e951366e9458899181fb95230a2815ed5fcdaa8
|
|
We don't actually parition by "formattable", we parition by "valid". An invalid number like 456-7890 can be formatted to E164 ("+14567890") but what ParitionedNumbers actually does is parition by valid/invalid (and then converts the valid numbers to E164).
Also added a new sharded test suite for phonenumberproto tests which had occasionally been timing out on TAP.
Test: existing
PiperOrigin-RevId: 181800443
Change-Id: Id64fc32c893025b0115dd350dd87e3277607f21c
|
|
Bug: 71763594
Test: Cp2LocalPhoneLookupTest, Cp2RemotePhoneLookupTest
PiperOrigin-RevId: 181681435
Change-Id: I2e091371b6705390adf4be63c78344f78bd19d6e
|
|
PhoneLookupInfo.cp2_local_info.
To support remote CP2 contacts, there will be a new PhoneLookup ("Cp2RemotePhoneLookup") and a new field in proto PhoneLookupInfo ("cp2_remote_info").
In proto PhoneLookupInfo, cp2_local_info and cp2_remote_info will be of the same type ("Cp2Info").
Bug: 71763594
Test: Existing tests
PiperOrigin-RevId: 181405798
Change-Id: I6c43b486229d4e9ae7b55c579d9c9997a2884c80
|
|
DialerFutures#firstMatching now fails if one of its provided futures fails before a match is found.
This is to accomodate the case where no source returns true for isDirty, but one or more fail; we want to be notified of the failure in that case and not silently treat that case as not dirty.
Also fixed a bug in NewCallLogFragment where the failed future wasn't causing the application to crash.
Also improved some related logging in RefreshAnnotatedCallLogWorker and Cp2PhoneLookup, and fixed a bug where empty numbers were not being handled correctly.
Bug: 71504246
Test: unit
PiperOrigin-RevId: 181401710
Change-Id: I23e207ac334ff80ac95b08a8f4f775a528a8c511
|
|
This is for performing work inside of the call log's RecyclerView, when the view holder is bound. Most of the time, this should be a no-op but there are possible edge cases where the call log data cannot be updated efficiently through the standard batch mechanism.
One example of this is when there are too many invalid numbers in the call log; the CP2 information for invalid numbers cannot be efficiently batch updated so we fetch this information at display time. (Note that we do handle up to 5 invalid numbers in the batch update mechanism, but if there are more than that we fallback to this realtime processing.)
Test: unit, manual
PiperOrigin-RevId: 181400016
Change-Id: Iea6b380742e757b48d19f319fe46dc5fae837604
|
|
"Invalid" numbers are identified according to PhoneNumberUtil.isValidNumber.
This is necessary to support loose matching for such numbers. However, ContactsContract.PhoneLookup only supports looking up individual numbers, which means that we cannot issue batch queries and must issue individiual queries for each invalid number.
The hope is that these numbers won't appear frequently so performance should still be acceptable.
However, as a failsafe, if there are more than 5 invalid numbers we just give up trying to bulk update the invalid numbers and signal that those numbers are INCOMPLETE so that the UI can query for their CP2 information on the fly (the UI will be updated in a future CL).
It was necessary to convert much of the class to use futures to support parallelization of the queries.
Bug: 71504246
Test: unit
PiperOrigin-RevId: 181216674
Change-Id: I3bec477d305772b4ca3e46d0bd326cfebf9fa313
|
|
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
|
|
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
|
|
Bug: 34672501
Test: unit
PiperOrigin-RevId: 179726904
Change-Id: I6a81ef28675af7f95139193b69f87decddc4c844
|
|
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
|
|
Bug: 34672501
Test: unit
PiperOrigin-RevId: 179278530
Change-Id: If629aa2c31efad790c8c70e8066dc9a5612d1fc3
|
|
This is necessary to support the case when the user has just upgraded to the new UI and there is no PhoneLookupHistory data yet, or they have cleared their data.
Bug: 70570635
Test: unit and manual
PiperOrigin-RevId: 179261139
Change-Id: I1e521d2e86bd3f8643c5c0bb537a52c41f1ceb6d
|
|
Bug: 34672501
Test: unit
PiperOrigin-RevId: 179012381
Change-Id: Icb78c73e243702a71f1a48692151b696ae2ac95f
|
|
We're not going to use the "cached" columns from the system call log any longer, and instead will write them using PhoneLookup.
Bug: 34672501
Test: unit
PiperOrigin-RevId: 178788155
Change-Id: I9255dd3cb727eef3b45bc05aeb3c6fd6fd513d63
|
|
This is just to more clearly convey what the method does.
Bug: 34672501
Test: existing
PiperOrigin-RevId: 178188575
Change-Id: Id02f34b1d79346ecd8ca9eebc043fe9b3063264b
|
|
Use them where appropriate.
Bug: 34672501
Test: existing
PiperOrigin-RevId: 178182298
Change-Id: If454225e0d636c7cb14b5af02d46780d7732abf0
|
|
When a call is added in InCallUi, it fetches the current PhoneLookupInfo for the call and writes it to PhoneLookupHistory.
Required updating PhoneLookupHistoryContentProvider#update to use "replace" to (presumably) atomically insert when a row is missing.
Bug: 34672501
Test: unit
PiperOrigin-RevId: 177896892
Change-Id: I43f9ded240a81156722be816a9635d586de642a1
|
|
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
|
|
Rewrote FakePhoneLookup to be more realistic.
Bug: 34672501
Test: unit
PiperOrigin-RevId: 177376374
Change-Id: Ifcd52b16b7046f39d1bfc0e8b8e76452a9daadd2
|
|
PhoneLookupInfo should contain one message per PhoneLookup implementation for clarity. Instead of having a repeated Cp2Info field, we now have a single Cp2Info field which wraps a repeated Cp2ContactInfo field.
Also added ApdlInfo to the message to make testing of CompositePhoneLookup more realistic, in that it tests merging across submessages now. (ApdlInfo is more or less a placeholder until ApdlPhoneLookup is implemented.)
Test: yes
PiperOrigin-RevId: 175316738
Change-Id: I196c2eaa885e1268ff80ebaad6d85840a9cc7a15
|
|
Test: Cp2PhoneLookupTest
PiperOrigin-RevId: 174525877
Change-Id: I7888f3b6adc58416c560271166ec6bd85306d58b
|
|
Fleshed out docs for PhoneLookup.
Added dagger components and modules.
Bug: 34672501
Test: unit
PiperOrigin-RevId: 173977963
Change-Id: If07795d9d3d56a59afd27cdda3e98543bf30fdb8
|
|
Checks if a cp2 contact has been modified or deleted.
Bug: 67605130,64099602
Test: Cp2PhoneLookupTest
PiperOrigin-RevId: 173499443
Change-Id: I1fa267c05732fba09f00113232d4370b159aa735
|
|
Bug: 67605130
Test: Cp2PhoneLookupTest
PiperOrigin-RevId: 171757865
Change-Id: If92e759567456dda09a925e9c625df001f2d573f
|