From 142362f8253e7456640c14d6acaf1969afc4b68d Mon Sep 17 00:00:00 2001 From: Yorke Lee Date: Tue, 28 Jul 2015 12:58:15 -0700 Subject: Start contact info cache query thread in onResume Bug: 22783484 Change-Id: If7881ad6a18eafe0b2ea8411b8472ba444320991 --- src/com/android/dialer/calllog/CallLogAdapter.java | 6 ++++++ src/com/android/dialer/calllog/CallLogFragment.java | 1 + 2 files changed, 7 insertions(+) diff --git a/src/com/android/dialer/calllog/CallLogAdapter.java b/src/com/android/dialer/calllog/CallLogAdapter.java index 54552914a..85d1c383a 100644 --- a/src/com/android/dialer/calllog/CallLogAdapter.java +++ b/src/com/android/dialer/calllog/CallLogAdapter.java @@ -367,6 +367,12 @@ public class CallLogAdapter extends GroupingListAdapter mContactInfoCache.invalidate(); } + public void startCache() { + if (PermissionsUtil.hasPermission(mContext, android.Manifest.permission.READ_CONTACTS)) { + mContactInfoCache.start(); + } + } + public void pauseCache() { mContactInfoCache.stop(); mTelecomCallLogCache.reset(); diff --git a/src/com/android/dialer/calllog/CallLogFragment.java b/src/com/android/dialer/calllog/CallLogFragment.java index 59e2c7f38..e7b77646d 100644 --- a/src/com/android/dialer/calllog/CallLogFragment.java +++ b/src/com/android/dialer/calllog/CallLogFragment.java @@ -338,6 +338,7 @@ public class CallLogFragment extends Fragment implements CallLogQueryHandler.Lis } mHasReadCallLogPermission = hasReadCallLogPermission; refreshData(); + mAdapter.startCache(); } @Override -- cgit v1.2.3