diff options
author | Tyler Gunn <tgunn@google.com> | 2014-06-12 18:44:02 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2014-06-12 05:34:42 +0000 |
commit | dbb81510c4d6d749fa9fc1ebf87ef76b949f200a (patch) | |
tree | ff58a1eafcd1b55482c0a1728cedeadacf9bc349 | |
parent | 480c64d622434bbd407f0fff7a6f2ece268782ef (diff) | |
parent | 746dba885dc50c9f723456b01cfc7dbfcc9a49b0 (diff) |
Merge "Prevent existing cached normalized numbers from being overwritten."
-rw-r--r-- | src/com/android/dialer/calllog/CallLogAdapter.java | 4 | ||||
-rw-r--r-- | src/com/android/dialer/calllog/ContactInfoHelper.java | 2 |
2 files changed, 5 insertions, 1 deletions
diff --git a/src/com/android/dialer/calllog/CallLogAdapter.java b/src/com/android/dialer/calllog/CallLogAdapter.java index 4b1aeabe5..249c30c41 100644 --- a/src/com/android/dialer/calllog/CallLogAdapter.java +++ b/src/com/android/dialer/calllog/CallLogAdapter.java @@ -1096,7 +1096,9 @@ public class CallLogAdapter extends GroupingListAdapter values.put(Calls.CACHED_LOOKUP_URI, UriUtils.uriToString(updatedInfo.lookupUri)); needsUpdate = true; } - if (!TextUtils.equals(updatedInfo.normalizedNumber, callLogInfo.normalizedNumber)) { + // Only replace the normalized number if the new updated normalized number isn't empty. + if (!TextUtils.isEmpty(updatedInfo.normalizedNumber) && + !TextUtils.equals(updatedInfo.normalizedNumber, callLogInfo.normalizedNumber)) { values.put(Calls.CACHED_NORMALIZED_NUMBER, updatedInfo.normalizedNumber); needsUpdate = true; } diff --git a/src/com/android/dialer/calllog/ContactInfoHelper.java b/src/com/android/dialer/calllog/ContactInfoHelper.java index 5d99ef4fb..1bebfc416 100644 --- a/src/com/android/dialer/calllog/ContactInfoHelper.java +++ b/src/com/android/dialer/calllog/ContactInfoHelper.java @@ -101,6 +101,8 @@ public class ContactInfoHelper { updatedInfo = new ContactInfo(); updatedInfo.number = number; updatedInfo.formattedNumber = formatPhoneNumber(number, null, countryIso); + updatedInfo.normalizedNumber = PhoneNumberUtils.formatNumberToE164( + number, countryIso); updatedInfo.lookupUri = createTemporaryContactUri(updatedInfo.formattedNumber); } else { updatedInfo = info; |