diff options
Diffstat (limited to 'src/com/android/dialer/list/RegularSearchFragment.java')
-rw-r--r-- | src/com/android/dialer/list/RegularSearchFragment.java | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/src/com/android/dialer/list/RegularSearchFragment.java b/src/com/android/dialer/list/RegularSearchFragment.java index 47dd07532..ccbd3d0dc 100644 --- a/src/com/android/dialer/list/RegularSearchFragment.java +++ b/src/com/android/dialer/list/RegularSearchFragment.java @@ -15,10 +15,17 @@ */ package com.android.dialer.list; +import com.android.contacts.common.list.ContactEntryListAdapter; +import com.android.dialerbind.ServiceFactory; +import com.android.dialer.service.CachedNumberLookupService; + public class RegularSearchFragment extends SearchFragment { private static final int SEARCH_DIRECTORY_RESULT_LIMIT = 5; + private static final CachedNumberLookupService mCachedNumberLookupService = + ServiceFactory.newCachedNumberLookupService(); + public RegularSearchFragment() { configureDirectorySearch(); } @@ -27,4 +34,22 @@ public class RegularSearchFragment extends SearchFragment { setDirectorySearchEnabled(true); setDirectoryResultLimit(SEARCH_DIRECTORY_RESULT_LIMIT); } + + @Override + protected ContactEntryListAdapter createListAdapter() { + RegularSearchListAdapter adapter = new RegularSearchListAdapter(getActivity()); + adapter.setDisplayPhotos(true); + adapter.setUseCallableUri(usesCallableUri()); + return adapter; + } + + @Override + protected void cacheContactInfo(int position) { + if (mCachedNumberLookupService != null) { + final RegularSearchListAdapter adapter = + (RegularSearchListAdapter) getAdapter(); + mCachedNumberLookupService.addContact(getContext(), + adapter.getContactInfo(position)); + } + } } |