summaryrefslogtreecommitdiff
path: root/src/com/android/dialer/filterednumber/NumbersAdapter.java
diff options
context:
space:
mode:
authorWenyi Wang <wenyiw@google.com>2015-11-24 15:31:41 -0800
committerWenyi Wang <wenyiw@google.com>2015-11-30 09:55:21 -0800
commit8005ef13459021aaf1ef0f9ed545fb714df4bfc5 (patch)
tree322040137febfb84a1f679a99519cc6da5c36fda /src/com/android/dialer/filterednumber/NumbersAdapter.java
parenta31f24c1ace1ed10b87daa8d23af58e6598fa075 (diff)
Avoid using prioritized mimetype on pre-M SDKs
Restores code deleted in ag/643285 because the code was used on pre-M. Bug:25629359 Change-Id: Ief60d301fd8d3c018ce03388c56264a2db727224
Diffstat (limited to 'src/com/android/dialer/filterednumber/NumbersAdapter.java')
-rw-r--r--src/com/android/dialer/filterednumber/NumbersAdapter.java8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/com/android/dialer/filterednumber/NumbersAdapter.java b/src/com/android/dialer/filterednumber/NumbersAdapter.java
index 170610712..4e2e578a8 100644
--- a/src/com/android/dialer/filterednumber/NumbersAdapter.java
+++ b/src/com/android/dialer/filterednumber/NumbersAdapter.java
@@ -20,6 +20,7 @@ import android.app.FragmentManager;
import android.content.Context;
import android.content.res.Resources;
import android.provider.ContactsContract;
+import android.provider.ContactsContract.CommonDataKinds.Phone;
import android.text.BidiFormatter;
import android.text.TextDirectionHeuristics;
import android.text.TextUtils;
@@ -30,6 +31,7 @@ import android.widget.TextView;
import com.android.contacts.common.ContactPhotoManager;
import com.android.contacts.common.ContactPhotoManager.DefaultImageRequest;
+import com.android.contacts.common.compat.CompatUtils;
import com.android.contacts.common.util.UriUtils;
import com.android.dialer.R;
import com.android.dialer.calllog.ContactInfo;
@@ -63,9 +65,9 @@ public class NumbersAdapter extends SimpleCursorAdapter {
final QuickContactBadge quickContactBadge =
(QuickContactBadge) view.findViewById(R.id.quick_contact_photo);
quickContactBadge.setOverlay(null);
- quickContactBadge.setPrioritizedMimeType(
- ContactsContract.CommonDataKinds.Phone.CONTENT_ITEM_TYPE);
-
+ if (CompatUtils.hasPrioritizedMimeType()) {
+ quickContactBadge.setPrioritizedMimeType(Phone.CONTENT_ITEM_TYPE);
+ }
final ContactInfo info = mContactInfoHelper.lookupNumber(number, countryIso);
final CharSequence locationOrType = getNumberTypeOrLocation(info);
final String displayNumber = getDisplayNumber(info);