diff options
| author | Flavio Lerda <flerda@google.com> | 2011-11-23 11:21:04 +0000 |
|---|---|---|
| committer | Flavio Lerda <flerda@google.com> | 2011-11-23 11:21:04 +0000 |
| commit | 76ced03e35e37d717a8c0bc0cca3b3f28609d85e (patch) | |
| tree | bb83b69e6ffe73c5dc3eae0e5bf6988634db62f7 | |
| parent | eb765ac75178eccf5a44a3410e21a7f88419fd84 (diff) | |
| download | packages_apps_Contacts-76ced03e35e37d717a8c0bc0cca3b3f28609d85e.tar.gz packages_apps_Contacts-76ced03e35e37d717a8c0bc0cca3b3f28609d85e.tar.bz2 packages_apps_Contacts-76ced03e35e37d717a8c0bc0cca3b3f28609d85e.zip | |
Follow-up on previous fix.
Correctly handle the case of a null country iso when working with an
upgraded call log.
The syntax for nulls requires the value to be passes as "IS NULL"
instead of using "= ?" and passing a null value.
Bug: 5638376
Change-Id: Icdc0278570495d4abff453e8505649c2b7425c99
| -rw-r--r-- | src/com/android/contacts/calllog/CallLogAdapter.java | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/src/com/android/contacts/calllog/CallLogAdapter.java b/src/com/android/contacts/calllog/CallLogAdapter.java index 37beba3cf..99ba8e8fc 100644 --- a/src/com/android/contacts/calllog/CallLogAdapter.java +++ b/src/com/android/contacts/calllog/CallLogAdapter.java @@ -650,14 +650,15 @@ import libcore.util.Objects; return; } - StringBuilder where = new StringBuilder(); - where.append(Calls.NUMBER); - where.append(" = ? AND "); - where.append(Calls.COUNTRY_ISO); - where.append(" = ?"); - - mContext.getContentResolver().update(Calls.CONTENT_URI_WITH_VOICEMAIL, values, - where.toString(), new String[]{ number, countryIso }); + if (countryIso == null) { + mContext.getContentResolver().update(Calls.CONTENT_URI_WITH_VOICEMAIL, values, + Calls.NUMBER + " = ? AND " + Calls.COUNTRY_ISO + " IS NULL", + new String[]{ number }); + } else { + mContext.getContentResolver().update(Calls.CONTENT_URI_WITH_VOICEMAIL, values, + Calls.NUMBER + " = ? AND " + Calls.COUNTRY_ISO + " = ?", + new String[]{ number, countryIso }); + } } /** Returns the contact information as stored in the call log. */ |
