diff options
author | linyuh <linyuh@google.com> | 2017-10-17 13:31:27 -0700 |
---|---|---|
committer | Eric Erfanian <erfanian@google.com> | 2017-10-17 22:45:59 +0000 |
commit | 6f78d935ff64f178e9fe8891082c18578d4e4b74 (patch) | |
tree | 8bb6b163a88cf321073913c2b0b7dad5ecbd854e /java/com/android/incallui/autoresizetext | |
parent | 68cc4733e1619e1b6b7f6d5f52ab057cc48525bb (diff) |
Stop showing partially matched numbers that are not global phone numbers.
When determining whether two phone numbers are identical enough for caller ID purposes, the Contacts Provider ignores special dialable characters such as '#', '*', '+', etc. This makes it possible for the cursor returned by the Contacts Provider to have multiple rows even when the URI asks for a specific number.
For example, suppose the user has two contacts whose numbers are "#123" and "123", respectively. When the URI asks for number "123", both numbers will be returned. Therefore, the following strategy is employed to find a match.
If the cursor points to a global phone number (i.e., a number that can be accepted by PhoneNumberUtils#isGlobalPhoneNumber(String)) and the lookup number in the URI is a PARTIAL match, the cursor is a match.
If the cursor points to a number that is not a global phone number, the cursor is a match iff the lookup number in the URI is an EXACT match.
There is no matched cursor in all other circumstances.
UI demo:
Suppose the user has a contact named "Service1" with number "#123".
Before:
Incall UI after the user dials "123": https://photos.app.goo.gl/xFWCD4qy2VR3YEuJ2
Call log UI after the call ends: https://photos.app.goo.gl/FT28GdTBy1dtANtI2
After:
Incall UI after the user dials "123": https://photos.app.goo.gl/Io3BisQmsyfnvitV2
Call log UI after the call ends: https://photos.app.goo.gl/6GgRrmx75yUTga3B3
Bug: 30225112
Test: PhoneNumberHelperTest
PiperOrigin-RevId: 172505648
Change-Id: Ida554313455ff9ce40432897681f89f58d64af04
Diffstat (limited to 'java/com/android/incallui/autoresizetext')
0 files changed, 0 insertions, 0 deletions