Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit c40c2d99 authored by zachh's avatar zachh Committed by Copybara-Service
Browse files

Use ContactsContract.PhoneLookup for invalid numbers in Cp2PhoneLookup.

"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
parent fdbf2a0d
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment