summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMakoto Onuki <omakoto@google.com>2015-03-17 18:25:51 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2015-03-17 18:25:52 +0000
commitb33c21f85eff3572aab68d5fafe053990e29e700 (patch)
tree9b4d03dab5e05c7bf471f5363497d13d433e076c /src
parente1b8593e78f9a645684bd1f0e3b6211fdccc92be (diff)
parent1a3405bc9dc16ffc9c23355ce9981ee7806d219f (diff)
downloadandroid_packages_apps_Dialer-b33c21f85eff3572aab68d5fafe053990e29e700.tar.gz
android_packages_apps_Dialer-b33c21f85eff3572aab68d5fafe053990e29e700.tar.bz2
android_packages_apps_Dialer-b33c21f85eff3572aab68d5fafe053990e29e700.zip
Merge "Do not cache non-contacts URI in calllog provider. (2/2)"
Diffstat (limited to 'src')
-rw-r--r--src/com/android/dialer/calllog/CallLogAdapter.java13
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 c4f6e89e1..57efc0121 100644
--- a/src/com/android/dialer/calllog/CallLogAdapter.java
+++ b/src/com/android/dialer/calllog/CallLogAdapter.java
@@ -1085,8 +1085,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)) {
@@ -1102,7 +1105,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;
}
@@ -1135,7 +1139,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;
}