diff options
author | Makoto Onuki <omakoto@google.com> | 2015-03-10 12:52:57 -0700 |
---|---|---|
committer | Makoto Onuki <omakoto@google.com> | 2015-03-10 12:58:09 -0700 |
commit | 1a3405bc9dc16ffc9c23355ce9981ee7806d219f (patch) | |
tree | 4cca271f80fa1610c714b20f0a92fe0aab225d32 | |
parent | fe7883236f57dea51914b7b5971f7988f36626a1 (diff) |
Do not cache non-contacts URI in calllog provider. (2/2)
Bug 19546108
Change-Id: I06d3d9326fac25cd8f84e96121e3c40eaa643cc0
-rw-r--r-- | src/com/android/dialer/calllog/CallLogAdapter.java | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/src/com/android/dialer/calllog/CallLogAdapter.java b/src/com/android/dialer/calllog/CallLogAdapter.java index 914520e84..36cf71024 100644 --- a/src/com/android/dialer/calllog/CallLogAdapter.java +++ b/src/com/android/dialer/calllog/CallLogAdapter.java @@ -1169,8 +1169,11 @@ public class CallLogAdapter extends GroupingListAdapter values.put(Calls.CACHED_PHOTO_ID, updatedInfo.photoId); needsUpdate = true; } - if (!UriUtils.areEqual(updatedInfo.photoUri, callLogInfo.photoUri)) { - values.put(Calls.CACHED_PHOTO_URI, UriUtils.uriToString(updatedInfo.photoUri)); + final Uri updatedPhotoUriContactsOnly = + UriUtils.nullForNonContactsUri(updatedInfo.photoUri); + if (!UriUtils.areEqual(updatedPhotoUriContactsOnly, callLogInfo.photoUri)) { + values.put(Calls.CACHED_PHOTO_URI, UriUtils.uriToString( + updatedPhotoUriContactsOnly)); needsUpdate = true; } if (!TextUtils.equals(updatedInfo.formattedNumber, callLogInfo.formattedNumber)) { @@ -1186,7 +1189,8 @@ public class CallLogAdapter extends GroupingListAdapter values.put(Calls.CACHED_MATCHED_NUMBER, updatedInfo.number); values.put(Calls.CACHED_NORMALIZED_NUMBER, updatedInfo.normalizedNumber); values.put(Calls.CACHED_PHOTO_ID, updatedInfo.photoId); - values.put(Calls.CACHED_PHOTO_URI, UriUtils.uriToString(updatedInfo.photoUri)); + values.put(Calls.CACHED_PHOTO_URI, UriUtils.uriToString( + UriUtils.nullForNonContactsUri(updatedInfo.photoUri))); values.put(Calls.CACHED_FORMATTED_NUMBER, updatedInfo.formattedNumber); needsUpdate = true; } @@ -1219,7 +1223,8 @@ public class CallLogAdapter extends GroupingListAdapter info.number = matchedNumber == null ? c.getString(CallLogQuery.NUMBER) : matchedNumber; info.normalizedNumber = c.getString(CallLogQuery.CACHED_NORMALIZED_NUMBER); info.photoId = c.getLong(CallLogQuery.CACHED_PHOTO_ID); - info.photoUri = UriUtils.parseUriOrNull(c.getString(CallLogQuery.CACHED_PHOTO_URI)); + info.photoUri = UriUtils.nullForNonContactsUri( + UriUtils.parseUriOrNull(c.getString(CallLogQuery.CACHED_PHOTO_URI))); info.formattedNumber = c.getString(CallLogQuery.CACHED_FORMATTED_NUMBER); return info; } |