diff options
author | Yorke Lee <yorkelee@google.com> | 2013-10-22 14:11:12 -0700 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2013-10-22 14:11:12 -0700 |
commit | 324439040dc66d6d929efe09a1bcba725abb665a (patch) | |
tree | bbd0fc1f86c1084342d4c91a2a7910ed691a0078 | |
parent | 45f8d99070ef77f0f2571accd55eb48030dce310 (diff) | |
parent | 934d3ee3052cfdd994e31ab2bcf00747fd9776d8 (diff) |
am 934d3ee3: Fix call log jank
* commit '934d3ee3052cfdd994e31ab2bcf00747fd9776d8':
Fix call log jank
-rw-r--r-- | src/com/android/dialer/calllog/CallLogAdapter.java | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/com/android/dialer/calllog/CallLogAdapter.java b/src/com/android/dialer/calllog/CallLogAdapter.java index 9392410d1..e4fd0d897 100644 --- a/src/com/android/dialer/calllog/CallLogAdapter.java +++ b/src/com/android/dialer/calllog/CallLogAdapter.java @@ -388,7 +388,16 @@ public class CallLogAdapter extends GroupingListAdapter NumberWithCountryIso numberCountryIso = new NumberWithCountryIso(number, countryIso); ContactInfo existingInfo = mContactInfoCache.getPossiblyExpired(numberCountryIso); - boolean updated = !info.equals(existingInfo); + final boolean isRemoteSource = info.sourceType != 0; + + // Don't force redraw if existing info in the cache is equal to {@link ContactInfo#EMPTY} + // to avoid updating the data set for every new row that is scrolled into view. + // see (https://googleplex-android-review.git.corp.google.com/#/c/166680/) + + // Exception: Photo uris for contacts from remote sources are not cached in the call log + // cache, so we have to force a redraw for these contacts regardless. + boolean updated = (existingInfo != ContactInfo.EMPTY || isRemoteSource) && + !info.equals(existingInfo); // Store the data in the cache so that the UI thread can use to display it. Store it // even if it has not changed so that it is marked as not expired. |