diff options
Diffstat (limited to 'java/com/android/contacts/common/list')
7 files changed, 19 insertions, 17 deletions
diff --git a/java/com/android/contacts/common/list/ContactEntryListAdapter.java b/java/com/android/contacts/common/list/ContactEntryListAdapter.java index 7335297e0..117825dce 100644 --- a/java/com/android/contacts/common/list/ContactEntryListAdapter.java +++ b/java/com/android/contacts/common/list/ContactEntryListAdapter.java @@ -32,8 +32,6 @@ import android.view.ViewGroup; import android.widget.QuickContactBadge; import android.widget.SectionIndexer; import android.widget.TextView; -import com.android.contacts.common.ContactPhotoManager; -import com.android.contacts.common.ContactPhotoManager.DefaultImageRequest; import com.android.contacts.common.ContactsUtils; import com.android.contacts.common.R; import com.android.contacts.common.compat.DirectoryCompat; @@ -41,6 +39,8 @@ import com.android.contacts.common.util.SearchUtil; import com.android.dialer.common.LogUtil; import com.android.dialer.compat.CompatUtils; import com.android.dialer.configprovider.ConfigProviderBindings; +import com.android.dialer.contactphoto.ContactPhotoManager; +import com.android.dialer.contactphoto.ContactPhotoManager.DefaultImageRequest; import com.android.dialer.logging.InteractionEvent; import com.android.dialer.logging.Logger; import java.util.HashSet; diff --git a/java/com/android/contacts/common/list/ContactEntryListFragment.java b/java/com/android/contacts/common/list/ContactEntryListFragment.java index 04658be89..94551a8c8 100644 --- a/java/com/android/contacts/common/list/ContactEntryListFragment.java +++ b/java/com/android/contacts/common/list/ContactEntryListFragment.java @@ -43,10 +43,10 @@ import android.widget.AdapterView; import android.widget.AdapterView.OnItemClickListener; import android.widget.ListView; import com.android.common.widget.CompositeCursorAdapter.Partition; -import com.android.contacts.common.ContactPhotoManager; import com.android.contacts.common.preference.ContactsPreferences; import com.android.contacts.common.util.ContactListViewUtils; import com.android.dialer.common.LogUtil; +import com.android.dialer.contactphoto.ContactPhotoManager; import com.android.dialer.performancereport.PerformanceReport; import java.lang.ref.WeakReference; import java.util.Locale; diff --git a/java/com/android/contacts/common/list/ContactListAdapter.java b/java/com/android/contacts/common/list/ContactListAdapter.java index 6cd311811..721609d1d 100644 --- a/java/com/android/contacts/common/list/ContactListAdapter.java +++ b/java/com/android/contacts/common/list/ContactListAdapter.java @@ -23,9 +23,9 @@ import android.provider.ContactsContract.Contacts; import android.provider.ContactsContract.Directory; import android.provider.ContactsContract.SearchSnippets; import android.view.ViewGroup; -import com.android.contacts.common.ContactPhotoManager.DefaultImageRequest; import com.android.contacts.common.R; import com.android.contacts.common.preference.ContactsPreferences; +import com.android.dialer.contactphoto.ContactPhotoManager.DefaultImageRequest; /** * A cursor adapter for the {@link ContactsContract.Contacts#CONTENT_TYPE} content type. Also diff --git a/java/com/android/contacts/common/list/ContactListFilterController.java b/java/com/android/contacts/common/list/ContactListFilterController.java index d2168f3f2..c5c078cb4 100644 --- a/java/com/android/contacts/common/list/ContactListFilterController.java +++ b/java/com/android/contacts/common/list/ContactListFilterController.java @@ -75,13 +75,13 @@ public abstract class ContactListFilterController { */ class ContactListFilterControllerImpl extends ContactListFilterController { - private final Context mContext; + private final Context mAppContext; private final List<ContactListFilterListener> mListeners = new ArrayList<ContactListFilterListener>(); private ContactListFilter mFilter; public ContactListFilterControllerImpl(Context context) { - mContext = context; + mAppContext = context.getApplicationContext(); mFilter = ContactListFilter.restoreDefaultPreferences(getSharedPreferences()); checkFilterValidity(true /* notify listeners */); } @@ -102,7 +102,7 @@ class ContactListFilterControllerImpl extends ContactListFilterController { } private SharedPreferences getSharedPreferences() { - return PreferenceManager.getDefaultSharedPreferences(mContext); + return PreferenceManager.getDefaultSharedPreferences(mAppContext); } @Override @@ -162,7 +162,7 @@ class ContactListFilterControllerImpl extends ContactListFilterController { /** @return true if the Account for the current filter exists. */ private boolean filterAccountExists() { - final AccountTypeManager accountTypeManager = AccountTypeManager.getInstance(mContext); + final AccountTypeManager accountTypeManager = AccountTypeManager.getInstance(mAppContext); final AccountWithDataSet filterAccount = new AccountWithDataSet(mFilter.accountName, mFilter.accountType, mFilter.dataSet); return accountTypeManager.contains(filterAccount, false); diff --git a/java/com/android/contacts/common/list/ContactTileView.java b/java/com/android/contacts/common/list/ContactTileView.java index 15582d684..cfd52f385 100644 --- a/java/com/android/contacts/common/list/ContactTileView.java +++ b/java/com/android/contacts/common/list/ContactTileView.java @@ -23,13 +23,13 @@ import android.view.View; import android.widget.FrameLayout; import android.widget.ImageView; import android.widget.TextView; -import com.android.contacts.common.ContactPhotoManager; -import com.android.contacts.common.ContactPhotoManager.DefaultImageRequest; import com.android.contacts.common.MoreContactUtils; import com.android.contacts.common.R; import com.android.dialer.callintent.CallInitiationType; import com.android.dialer.callintent.CallSpecificAppData; import com.android.dialer.common.LogUtil; +import com.android.dialer.contactphoto.ContactPhotoManager; +import com.android.dialer.contactphoto.ContactPhotoManager.DefaultImageRequest; /** A ContactTile displays a contact's picture and name */ public abstract class ContactTileView extends FrameLayout { @@ -65,6 +65,7 @@ public abstract class ContactTileView extends FrameLayout { CallSpecificAppData callSpecificAppData = CallSpecificAppData.newBuilder() .setCallInitiationType(CallInitiationType.Type.SPEED_DIAL) + .setAllowAssistedDialing(true) .build(); mListener.onContactSelected( getLookupUri(), diff --git a/java/com/android/contacts/common/list/PhoneNumberListAdapter.java b/java/com/android/contacts/common/list/PhoneNumberListAdapter.java index ae15eb232..71d9dad5f 100644 --- a/java/com/android/contacts/common/list/PhoneNumberListAdapter.java +++ b/java/com/android/contacts/common/list/PhoneNumberListAdapter.java @@ -31,25 +31,25 @@ import android.support.annotation.VisibleForTesting; import android.text.TextUtils; import android.view.View; import android.view.ViewGroup; -import com.android.contacts.common.ContactPhotoManager.DefaultImageRequest; import com.android.contacts.common.ContactsUtils; import com.android.contacts.common.R; import com.android.contacts.common.compat.CallableCompat; import com.android.contacts.common.compat.DirectoryCompat; import com.android.contacts.common.compat.PhoneCompat; import com.android.contacts.common.extensions.PhoneDirectoryExtenderAccessor; -import com.android.contacts.common.lettertiles.LetterTileDrawable; import com.android.contacts.common.list.ContactListItemView.CallToAction; import com.android.contacts.common.preference.ContactsPreferences; import com.android.contacts.common.util.Constants; import com.android.dialer.common.LogUtil; import com.android.dialer.compat.CompatUtils; +import com.android.dialer.contactphoto.ContactPhotoManager.DefaultImageRequest; import com.android.dialer.dialercontact.DialerContact; import com.android.dialer.enrichedcall.EnrichedCallCapabilities; import com.android.dialer.enrichedcall.EnrichedCallComponent; import com.android.dialer.enrichedcall.EnrichedCallManager; +import com.android.dialer.lettertile.LetterTileDrawable; import com.android.dialer.lightbringer.LightbringerComponent; -import com.android.dialer.location.GeoUtil; +import com.android.dialer.phonenumberutil.PhoneNumberHelper; import com.android.dialer.util.CallUtil; import java.util.ArrayList; import java.util.Arrays; @@ -381,7 +381,7 @@ public class PhoneNumberListAdapter extends ContactEntryListAdapter { text = phoneLabel; } else { final String phoneNumber = cursor.getString(PhoneQuery.PHONE_NUMBER); - text = GeoUtil.getGeocodedLocationFor(mContext, phoneNumber); + text = PhoneNumberHelper.getGeoDescription(mContext, phoneNumber); } } view.setPhoneNumber(text); @@ -407,7 +407,7 @@ public class PhoneNumberListAdapter extends ContactEntryListAdapter { if (action == ContactListItemView.NONE) { EnrichedCallManager manager = EnrichedCallComponent.get(mContext).getEnrichedCallManager(); EnrichedCallCapabilities capabilities = manager.getCapabilities(number); - if (capabilities != null && capabilities.supportsCallComposer()) { + if (capabilities != null && capabilities.isCallComposerCapable()) { action = ContactListItemView.CALL_AND_SHARE; } else if (capabilities == null && getQueryString() != null diff --git a/java/com/android/contacts/common/list/PhoneNumberPickerFragment.java b/java/com/android/contacts/common/list/PhoneNumberPickerFragment.java index de7903e83..d704e5492 100644 --- a/java/com/android/contacts/common/list/PhoneNumberPickerFragment.java +++ b/java/com/android/contacts/common/list/PhoneNumberPickerFragment.java @@ -235,6 +235,7 @@ public class PhoneNumberPickerFragment extends ContactEntryListFragment<ContactE cacheContactInfo(position); CallSpecificAppData callSpecificAppData = CallSpecificAppData.newBuilder() + .setAllowAssistedDialing(true) .setCallInitiationType(getCallInitiationType(true /* isRemoteDirectory */)) .setPositionOfSelectedSearchResult(position) .setCharactersInSearchString(getQueryString() == null ? 0 : getQueryString().length()) @@ -278,7 +279,7 @@ public class PhoneNumberPickerFragment extends ContactEntryListFragment<ContactE @MainThread public void onLoadFinished(Loader<Cursor> loader, Cursor data) { Assert.isMainThread(); - // TODO: define and verify behavior for "Nearby places", corp directories, + // TODO(strongarm): define and verify behavior for "Nearby places", corp directories, // and dividers listed in UI between these categories if (mCursorReranker != null && data != null @@ -353,7 +354,7 @@ public class PhoneNumberPickerFragment extends ContactEntryListFragment<ContactE if (view.getCallToAction() != ContactListItemView.NONE || view.getPhoneNumber() == null || manager.getCapabilities(view.getPhoneNumber()) == null - || !manager.getCapabilities(view.getPhoneNumber()).supportsCallComposer()) { + || !manager.getCapabilities(view.getPhoneNumber()).isCallComposerCapable()) { continue; } view.setCallToAction(ContactListItemView.CALL_AND_SHARE, listener, view.getPosition()); |