QuickContacts can prioritize phone mimetype. Part2

Whenever using QuickContacts in Dialer, make sure to
prioritize the phone mimetype.

Bug: 18391003
Change-Id: Ie5a93ad9e1919f470a638d4235d91fe337cb5ca3
diff --git a/src/com/android/dialer/CallDetailActivity.java b/src/com/android/dialer/CallDetailActivity.java
index fb663d7..df8197a 100644
--- a/src/com/android/dialer/CallDetailActivity.java
+++ b/src/com/android/dialer/CallDetailActivity.java
@@ -245,6 +245,7 @@
 
         mQuickContactBadge = (QuickContactBadge) findViewById(R.id.quick_contact_photo);
         mQuickContactBadge.setOverlay(null);
+        mQuickContactBadge.setPrioritizedMimeType(Phone.CONTENT_ITEM_TYPE);
         mCallerName = (TextView) findViewById(R.id.caller_name);
         mCallerNumber = (TextView) findViewById(R.id.caller_number);
         mAccountLabel = (TextView) findViewById(R.id.phone_account_label);
diff --git a/src/com/android/dialer/calllog/CallLogAdapter.java b/src/com/android/dialer/calllog/CallLogAdapter.java
index b6f91e7..8bfe0de 100644
--- a/src/com/android/dialer/calllog/CallLogAdapter.java
+++ b/src/com/android/dialer/calllog/CallLogAdapter.java
@@ -27,6 +27,7 @@
 import android.os.Message;
 import android.provider.CallLog.Calls;
 import android.provider.ContactsContract;
+import android.provider.ContactsContract.CommonDataKinds.Phone;
 import android.provider.ContactsContract.PhoneLookup;
 import android.telecom.PhoneAccountHandle;
 import android.telephony.PhoneNumberUtils;
@@ -820,6 +821,7 @@
         } else {
             setPhoto(views, photoId, lookupUri, nameForDefaultImage, lookupKey, contactType);
         }
+        views.quickContactView.setPrioritizedMimeType(Phone.CONTENT_ITEM_TYPE);
 
         // Listen for the first draw
         if (mViewTreeObserver == null) {
diff --git a/src/com/android/dialer/list/AllContactsFragment.java b/src/com/android/dialer/list/AllContactsFragment.java
index deabb80..94efc48 100644
--- a/src/com/android/dialer/list/AllContactsFragment.java
+++ b/src/com/android/dialer/list/AllContactsFragment.java
@@ -18,6 +18,7 @@
 
 import android.database.Cursor;
 import android.net.Uri;
+import android.provider.ContactsContract.CommonDataKinds.Phone;
 import android.provider.ContactsContract.QuickContact;
 import android.view.LayoutInflater;
 import android.view.View;
@@ -83,7 +84,8 @@
     public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
         final Uri uri = (Uri) view.getTag();
         if (uri != null) {
-            QuickContact.showQuickContact(getActivity(), view, uri, QuickContact.MODE_LARGE, null);
+            QuickContact.showQuickContact(getContext(), view, uri, null,
+                    Phone.CONTENT_ITEM_TYPE);
         }
     }
 
diff --git a/src/com/android/dialer/list/PhoneFavoriteSquareTileView.java b/src/com/android/dialer/list/PhoneFavoriteSquareTileView.java
index 5f88776..05780c6 100644
--- a/src/com/android/dialer/list/PhoneFavoriteSquareTileView.java
+++ b/src/com/android/dialer/list/PhoneFavoriteSquareTileView.java
@@ -17,6 +17,7 @@
 package com.android.dialer.list;
 
 import android.content.Context;
+import android.provider.ContactsContract.CommonDataKinds.Phone;
 import android.provider.ContactsContract.QuickContact;
 import android.util.AttributeSet;
 import android.view.View;
@@ -63,7 +64,7 @@
 
     private void launchQuickContact() {
         QuickContact.showQuickContact(getContext(), PhoneFavoriteSquareTileView.this,
-                getLookupUri(), QuickContact.MODE_LARGE, null);
+                getLookupUri(), null, Phone.CONTENT_ITEM_TYPE);
     }
 
     @Override