diff options
author | Dave Santoro <dsantoro@google.com> | 2011-12-13 14:06:12 -0800 |
---|---|---|
committer | Katherine Kuan <katherinekuan@google.com> | 2011-12-13 14:50:27 -0800 |
commit | 1bc8603830a07b4ff641bf74227c654c99a8473b (patch) | |
tree | 3e3094d2e7822e95e88c49d9f41581657e6c2032 /src | |
parent | a02fe8b40e342d4a9d0ece49c02fa3965a923927 (diff) | |
download | packages_providers_ContactsProvider-1bc8603830a07b4ff641bf74227c654c99a8473b.zip packages_providers_ContactsProvider-1bc8603830a07b4ff641bf74227c654c99a8473b.tar.gz packages_providers_ContactsProvider-1bc8603830a07b4ff641bf74227c654c99a8473b.tar.bz2 |
Cherry-pick Fix for GB upgrade issue with phone lookups.
This is a cherrypick from master for this CL
Iea81bc4163cb89169946f9a33f9e15b13e8868ad
This just generalizes a fix that Shaopeng had for Brazilian phone
numbers, in which it was possible that the caller ID number being
checked was shorter than the normalized number we had stored. We
essentially accept a phone number as a match if the shorter of
either (caller ID, normalized number) is a trailing prefix of the
other.
Bug: 5638376
Change-Id: Id61d5295272106a05af14d3c2ce1695eaf2dd372
Diffstat (limited to 'src')
-rw-r--r-- | src/com/android/providers/contacts/ContactsDatabaseHelper.java | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/src/com/android/providers/contacts/ContactsDatabaseHelper.java b/src/com/android/providers/contacts/ContactsDatabaseHelper.java index b1e5b6d..8940c61 100644 --- a/src/com/android/providers/contacts/ContactsDatabaseHelper.java +++ b/src/com/android/providers/contacts/ContactsDatabaseHelper.java @@ -4209,20 +4209,20 @@ import java.util.Locale; sb.append(','); sb.append(numberLen); sb.append(" - lookup.len + 1) = lookup.normalized_number"); + // Some countries (e.g. Brazil) can have incoming calls which contain only the local // number (no country calling code and no area code). This case is handled below. // Details see b/5197612. - if (!hasNumberE164) { - sb.append(" OR ("); - sb.append(" lookup.len > "); - sb.append(numberLen); - sb.append(" AND substr(lookup.normalized_number,"); - sb.append("lookup.len + 1 - "); - sb.append(numberLen); - sb.append(") = "); - DatabaseUtils.appendEscapedSQLString(sb, number); - sb.append(")"); - } + // This also handles a Gingerbread -> ICS upgrade issue; see b/5638376. + sb.append(" OR ("); + sb.append(" lookup.len > "); + sb.append(numberLen); + sb.append(" AND substr(lookup.normalized_number,"); + sb.append("lookup.len + 1 - "); + sb.append(numberLen); + sb.append(") = "); + DatabaseUtils.appendEscapedSQLString(sb, number); + sb.append(")"); } sb.append(')'); } |