diff options
author | Tyler Gunn <tgunn@google.com> | 2014-06-12 11:29:26 -0700 |
---|---|---|
committer | Tyler Gunn <tgunn@google.com> | 2014-06-12 11:29:26 -0700 |
commit | 746dba885dc50c9f723456b01cfc7dbfcc9a49b0 (patch) | |
tree | ce47d8ab9856798e962e8e1a22fb63aa6139f2b8 /src | |
parent | 7f72adf51f2fadb6f1a34f16f8e602c626d536d9 (diff) |
Prevent existing cached normalized numbers from being overwritten.
Fixed case where if a number is not in your contacts and it has a cached
normalized number in the call log, viewing the call log will delete the
normalized number.
Bug: 15591755
Change-Id: I7111ca6a2aacaebb0adfb15ccb5e6dc0792e2016
Diffstat (limited to 'src')
-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; |