am 4e97e09f: Switch from CALL -> CALL_PRIVILEGED

* commit '4e97e09f0ae58f6065252022fe5cf5f7d90aef01':
  Switch from CALL -> CALL_PRIVILEGED
diff --git a/res/values-te-rIN/strings.xml b/res/values-te-rIN/strings.xml
index ef88144..7b44738 100644
--- a/res/values-te-rIN/strings.xml
+++ b/res/values-te-rIN/strings.xml
@@ -136,8 +136,8 @@
     <string name="contact_list_loading" msgid="5488620820563977329">"లోడ్ చేస్తోంది…"</string>
     <string name="imei" msgid="3045126336951684285">"IMEI"</string>
     <string name="meid" msgid="6210568493746275750">"MEID"</string>
-    <string name="simContacts_emptyLoading" msgid="6700035985448642408">"SIM కార్డు నుండి లోడ్ చేస్తోంది…"</string>
-    <string name="simContacts_title" msgid="27341688347689769">"SIM కార్డు పరిచయాలు"</string>
+    <string name="simContacts_emptyLoading" msgid="6700035985448642408">"సిమ్ కార్డు నుండి లోడ్ చేస్తోంది…"</string>
+    <string name="simContacts_title" msgid="27341688347689769">"సిమ్ కార్డు పరిచయాలు"</string>
     <string name="add_contact_not_available" msgid="2731922990890769322">"ఈ లక్షణాన్ని ఉపయోగించడానికి పరిచయాల అనువర్తనాన్ని పునఃప్రారంభించండి."</string>
     <string name="voice_search_not_available" msgid="7580616740587850828">"వాయిస్ శోధన అందుబాటులో లేదు."</string>
     <string name="call_not_available" msgid="8941576511946492225">"ఫోన్ అనువర్తనం నిలిపివేయబడినందున ఫోన్ కాల్ చేయలేరు."</string>
diff --git a/src/com/android/dialer/CallDetailActivity.java b/src/com/android/dialer/CallDetailActivity.java
index e2ab130..f6b88cd 100644
--- a/src/com/android/dialer/CallDetailActivity.java
+++ b/src/com/android/dialer/CallDetailActivity.java
@@ -31,6 +31,7 @@
 import android.provider.ContactsContract.CommonDataKinds.Phone;
 import android.provider.VoicemailContract.Voicemails;
 import android.telecom.PhoneAccount;
+import android.telecom.PhoneAccountHandle;
 import android.telephony.TelephonyManager;
 import android.text.BidiFormatter;
 import android.text.TextDirectionHeuristics;
@@ -78,9 +79,6 @@
 public class CallDetailActivity extends AnalyticsActivity implements ProximitySensorAware {
     private static final String TAG = "CallDetail";
 
-    private static final int LOADER_ID = 0;
-    private static final String BUNDLE_CONTACT_URI_EXTRA = "contact_uri_extra";
-
     private static final char LEFT_TO_RIGHT_EMBEDDING = '\u202A';
     private static final char POP_DIRECTIONAL_FORMATTING = '\u202C';
 
@@ -238,7 +236,7 @@
         mResources = getResources();
 
         mCallTypeHelper = new CallTypeHelper(getResources());
-        mPhoneNumberHelper = new PhoneNumberDisplayHelper(mResources);
+        mPhoneNumberHelper = new PhoneNumberDisplayHelper(this, mResources);
         mVoicemailStatusHelper = new VoicemailStatusHelperImpl();
         mAsyncQueryHandler = new CallDetailActivityQueryHandler(this);
 
@@ -379,7 +377,7 @@
     /**
      * Update user interface with details of given call.
      *
-     * @param callUris URIs into {@link CallLog.Calls} of the calls to be displayed
+     * @param callUris URIs into {@link android.provider.CallLog.Calls} of the calls to be displayed
      */
     private void updateData(final Uri... callUris) {
         class UpdateContactDetailsTask extends AsyncTask<Void, Void, PhoneCallDetails[]> {
@@ -403,9 +401,11 @@
 
             @Override
             public void onPostExecute(PhoneCallDetails[] details) {
+                Context context = CallDetailActivity.this;
+
                 if (details == null) {
                     // Somewhere went wrong: we're going to bail out and show error to users.
-                    Toast.makeText(CallDetailActivity.this, R.string.toast_call_detail_error,
+                    Toast.makeText(context, R.string.toast_call_detail_error,
                             Toast.LENGTH_SHORT).show();
                     finish();
                     return;
@@ -418,24 +418,27 @@
                 final int numberPresentation = firstDetails.numberPresentation;
                 final Uri contactUri = firstDetails.contactUri;
                 final Uri photoUri = firstDetails.photoUri;
+                final PhoneAccountHandle accountHandle = firstDetails.accountHandle;
 
                 // Cache the details about the phone number.
                 final boolean canPlaceCallsTo =
                     PhoneNumberUtilsWrapper.canPlaceCallsTo(mNumber, numberPresentation);
-                final PhoneNumberUtilsWrapper phoneUtils = new PhoneNumberUtilsWrapper();
-                final boolean isVoicemailNumber = phoneUtils.isVoicemailNumber(mNumber);
-                final boolean isSipNumber = phoneUtils.isSipNumber(mNumber);
+                final PhoneNumberUtilsWrapper phoneUtils = new PhoneNumberUtilsWrapper(context);
+                final boolean isVoicemailNumber =
+                        phoneUtils.isVoicemailNumber(accountHandle, mNumber);
+                final boolean isSipNumber = PhoneNumberUtilsWrapper.isSipNumber(mNumber);
 
                 final CharSequence callLocationOrType = getNumberTypeOrLocation(firstDetails);
 
-                final CharSequence displayNumber = mPhoneNumberHelper.getDisplayNumber(
-                        firstDetails.number,
-                        firstDetails.numberPresentation,
-                        firstDetails.formattedNumber);
+                final CharSequence displayNumber =
+                        mPhoneNumberHelper.getDisplayNumber(
+                                firstDetails.accountHandle,
+                                firstDetails.number,
+                                firstDetails.numberPresentation,
+                                firstDetails.formattedNumber);
                 final String displayNumberStr = mBidiFormatter.unicodeWrap(
                         displayNumber.toString(), TextDirectionHeuristics.LTR);
 
-
                 if (!TextUtils.isEmpty(firstDetails.name)) {
                     mCallerName.setText(firstDetails.name);
                     mCallerNumber.setText(callLocationOrType + " " + displayNumberStr);
@@ -449,8 +452,9 @@
                     }
                 }
 
-                if (!TextUtils.isEmpty(firstDetails.accountLabel)) {
-                    mAccountLabel.setText(firstDetails.accountLabel);
+                String accountLabel = PhoneAccountUtils.getAccountLabel(context, accountHandle);
+                if (!TextUtils.isEmpty(accountLabel)) {
+                    mAccountLabel.setText(accountLabel);
                     mAccountLabel.setVisibility(View.VISIBLE);
                 } else {
                     mAccountLabel.setVisibility(View.GONE);
@@ -464,8 +468,7 @@
 
                 ListView historyList = (ListView) findViewById(R.id.history);
                 historyList.setAdapter(
-                        new CallDetailHistoryAdapter(CallDetailActivity.this, mInflater,
-                                mCallTypeHelper, details));
+                        new CallDetailHistoryAdapter(context, mInflater, mCallTypeHelper, details));
 
                 String lookupKey = contactUri == null ? null
                         : ContactInfoHelper.getLookupKeyFromUri(contactUri);
@@ -479,7 +482,9 @@
 
                 String nameForDefaultImage;
                 if (TextUtils.isEmpty(firstDetails.name)) {
-                    nameForDefaultImage = mPhoneNumberHelper.getDisplayNumber(firstDetails.number,
+                    nameForDefaultImage = mPhoneNumberHelper.getDisplayNumber(
+                            firstDetails.accountHandle,
+                            firstDetails.number,
                             firstDetails.numberPresentation,
                             firstDetails.formattedNumber).toString();
                 } else {
@@ -535,10 +540,9 @@
             final String geocode = callCursor.getString(GEOCODED_LOCATION_COLUMN_INDEX);
             final String transcription = callCursor.getString(TRANSCRIPTION_COLUMN_INDEX);
 
-            final String accountLabel = PhoneAccountUtils.getAccountLabel(this,
-                    PhoneAccountUtils.getAccount(
+            final PhoneAccountHandle accountHandle = PhoneAccountUtils.getAccount(
                     callCursor.getString(ACCOUNT_COMPONENT_NAME),
-                    callCursor.getString(ACCOUNT_ID)));
+                    callCursor.getString(ACCOUNT_ID));
 
             if (TextUtils.isEmpty(countryIso)) {
                 countryIso = mDefaultCountryIso;
@@ -556,11 +560,11 @@
             // If this is not a regular number, there is no point in looking it up in the contacts.
             ContactInfo info =
                     PhoneNumberUtilsWrapper.canPlaceCallsTo(number, numberPresentation)
-                    && !new PhoneNumberUtilsWrapper().isVoicemailNumber(number)
+                    && !new PhoneNumberUtilsWrapper(this).isVoicemailNumber(accountHandle, number)
                             ? mContactInfoHelper.lookupNumber(number, countryIso)
                             : null;
             if (info == null) {
-                formattedNumber = mPhoneNumberHelper.getDisplayNumber(number,
+                formattedNumber = mPhoneNumberHelper.getDisplayNumber(accountHandle, number,
                         numberPresentation, null);
                 nameText = "";
                 numberType = 0;
@@ -586,7 +590,7 @@
                     formattedNumber, countryIso, geocode,
                     new int[]{ callType }, date, duration,
                     nameText, numberType, numberLabel, lookupUri, photoUri, sourceType,
-                    accountLabel, null, features, dataUsage, transcription);
+                    accountHandle, features, dataUsage, transcription);
         } finally {
             if (callCursor != null) {
                 callCursor.close();
diff --git a/src/com/android/dialer/PhoneCallDetails.java b/src/com/android/dialer/PhoneCallDetails.java
index ba049a2..ec9657e 100644
--- a/src/com/android/dialer/PhoneCallDetails.java
+++ b/src/com/android/dialer/PhoneCallDetails.java
@@ -22,6 +22,7 @@
 import android.net.Uri;
 import android.provider.CallLog.Calls;
 import android.provider.ContactsContract.CommonDataKinds.Phone;
+import android.telecom.PhoneAccountHandle;
 
 /**
  * The details of a phone call to be shown in the UI.
@@ -66,14 +67,11 @@
      * The source type of the contact associated with this call.
      */
     public final int sourceType;
+
     /**
      * The unique identifier for the account associated with the call.
      */
-    public final String accountLabel;
-    /**
-     * The icon for the account associated with the call.
-     */
-    public final Drawable accountIcon;
+    public final PhoneAccountHandle accountHandle;
     /**
      * Features applicable to this call.
      */
@@ -96,26 +94,26 @@
             CharSequence formattedNumber, String countryIso, String geocode,
             int[] callTypes, long date, long duration) {
         this (number, numberPresentation, formattedNumber, countryIso, geocode,
-        callTypes, date, duration, "", 0, "", null, null, 0, null, null, 0, null, null);
+                callTypes, date, duration, "", 0, "", null, null, 0, null, 0, null, null);
     }
 
     /** Create the details for a call with a number not associated with a contact. */
     public PhoneCallDetails(CharSequence number, int numberPresentation,
             CharSequence formattedNumber, String countryIso, String geocode,
-            int[] callTypes, long date, long duration, String accountLabel, Drawable accountIcon,
-            int features, Long dataUsage, String transcription) {
-        this(number, numberPresentation, formattedNumber, countryIso, geocode,
-                callTypes, date, duration, "", 0, "", null, null, 0, accountLabel, accountIcon,
-                features, dataUsage, transcription);
+            int[] callTypes, long date, long duration,
+            PhoneAccountHandle accountHandle, int features, Long dataUsage, String transcription) {
+        this(number, numberPresentation, formattedNumber, countryIso, geocode, callTypes, date,
+                duration, "", 0, "", null, null, 0, accountHandle, features, dataUsage,
+                transcription);
     }
 
     /** Create the details for a call with a number associated with a contact. */
     public PhoneCallDetails(CharSequence number, int numberPresentation,
             CharSequence formattedNumber, String countryIso, String geocode,
             int[] callTypes, long date, long duration, CharSequence name,
-            int numberType, CharSequence numberLabel, Uri contactUri,
-            Uri photoUri, int sourceType, String accountLabel, Drawable accountIcon, int features,
-            Long dataUsage, String transcription) {
+            int numberType, CharSequence numberLabel, Uri contactUri, Uri photoUri,
+            int sourceType, PhoneAccountHandle accountHandle, int features, Long dataUsage,
+            String transcription) {
         this.number = number;
         this.numberPresentation = numberPresentation;
         this.formattedNumber = formattedNumber;
@@ -130,8 +128,7 @@
         this.contactUri = contactUri;
         this.photoUri = photoUri;
         this.sourceType = sourceType;
-        this.accountLabel = accountLabel;
-        this.accountIcon = accountIcon;
+        this.accountHandle = accountHandle;
         this.features = features;
         this.dataUsage = dataUsage;
         this.transcription = transcription;
diff --git a/src/com/android/dialer/PhoneCallDetailsHelper.java b/src/com/android/dialer/PhoneCallDetailsHelper.java
index c5f2fb6..e888431 100644
--- a/src/com/android/dialer/PhoneCallDetailsHelper.java
+++ b/src/com/android/dialer/PhoneCallDetailsHelper.java
@@ -16,7 +16,9 @@
 
 package com.android.dialer;
 
+import android.content.Context;
 import android.content.res.Resources;
+import android.graphics.drawable.Drawable;
 import android.provider.CallLog;
 import android.provider.CallLog.Calls;
 import android.provider.ContactsContract.CommonDataKinds.Phone;
@@ -28,8 +30,8 @@
 import com.android.contacts.common.CallUtil;
 import com.android.contacts.common.testing.NeededForTesting;
 import com.android.contacts.common.util.PhoneNumberHelper;
-import com.android.dialer.calllog.CallTypeHelper;
 import com.android.dialer.calllog.ContactInfo;
+import com.android.dialer.calllog.PhoneAccountUtils;
 import com.android.dialer.calllog.PhoneNumberDisplayHelper;
 import com.android.dialer.calllog.PhoneNumberUtilsWrapper;
 import com.android.dialer.util.DialerUtils;
@@ -44,6 +46,7 @@
     /** The maximum number of icons will be shown to represent the call types in a group. */
     private static final int MAX_CALL_TYPE_ICONS = 3;
 
+    private final Context mContext;
     private final Resources mResources;
     /** The injected current time in milliseconds since the epoch. Used only by tests. */
     private Long mCurrentTimeMillisForTest;
@@ -63,11 +66,12 @@
      *
      * @param resources used to look up strings
      */
-    public PhoneCallDetailsHelper(Resources resources, CallTypeHelper callTypeHelper,
+    public PhoneCallDetailsHelper(Context context, Resources resources,
             PhoneNumberUtilsWrapper phoneUtils) {
+        mContext = context;
         mResources = resources;
         mPhoneNumberUtilsWrapper = phoneUtils;
-        mPhoneNumberHelper = new PhoneNumberDisplayHelper(mPhoneNumberUtilsWrapper, resources);
+        mPhoneNumberHelper = new PhoneNumberDisplayHelper(context, resources, phoneUtils);
     }
 
     /** Fills the call details views with content. */
@@ -103,16 +107,17 @@
         setCallCountAndDate(views, callCount, callLocationAndDate);
 
         // set the account icon if it exists
-        if (details.accountIcon != null) {
+        Drawable accountIcon = PhoneAccountUtils.getAccountIcon(mContext, details.accountHandle);
+        if (accountIcon != null) {
             views.callAccountIcon.setVisibility(View.VISIBLE);
-            views.callAccountIcon.setImageDrawable(details.accountIcon);
+            views.callAccountIcon.setImageDrawable(accountIcon);
         } else {
             views.callAccountIcon.setVisibility(View.GONE);
         }
 
         final CharSequence nameText;
         final CharSequence displayNumber =
-            mPhoneNumberHelper.getDisplayNumber(details.number,
+            mPhoneNumberHelper.getDisplayNumber(details.accountHandle, details.number,
                     details.numberPresentation, details.formattedNumber);
         if (TextUtils.isEmpty(details.name)) {
             nameText = displayNumber;
@@ -169,7 +174,8 @@
         // Only show a label if the number is shown and it is not a SIP address.
         if (!TextUtils.isEmpty(details.number)
                 && !PhoneNumberHelper.isUriNumber(details.number.toString())
-                && !mPhoneNumberUtilsWrapper.isVoicemailNumber(details.number)) {
+                && !mPhoneNumberUtilsWrapper.isVoicemailNumber(details.accountHandle,
+                        details.number)) {
 
             if (details.numberLabel == ContactInfo.GEOCODE_AS_LABEL) {
                 numberFormattedLabel = details.geocode;
@@ -180,8 +186,8 @@
         }
 
         if (!TextUtils.isEmpty(details.name) && TextUtils.isEmpty(numberFormattedLabel)) {
-            numberFormattedLabel = mPhoneNumberHelper.getDisplayNumber(details.number,
-                    details.numberPresentation, details.formattedNumber);
+            numberFormattedLabel = mPhoneNumberHelper.getDisplayNumber(details.accountHandle,
+                    details.number, details.numberPresentation, details.formattedNumber);
         }
         return numberFormattedLabel;
     }
@@ -204,8 +210,9 @@
     public void setCallDetailsHeader(TextView nameView, PhoneCallDetails details) {
         final CharSequence nameText;
         final CharSequence displayNumber =
-            mPhoneNumberHelper.getDisplayNumber(details.number, details.numberPresentation,
-                        mResources.getString(R.string.recentCalls_addToContact));
+            mPhoneNumberHelper.getDisplayNumber(details.accountHandle, details.number,
+                    details.numberPresentation,
+                    mResources.getString(R.string.recentCalls_addToContact));
         if (TextUtils.isEmpty(details.name)) {
             nameText = displayNumber;
         } else {
diff --git a/src/com/android/dialer/SpecialCharSequenceMgr.java b/src/com/android/dialer/SpecialCharSequenceMgr.java
index 14b26ec..8e56e45 100644
--- a/src/com/android/dialer/SpecialCharSequenceMgr.java
+++ b/src/com/android/dialer/SpecialCharSequenceMgr.java
@@ -39,6 +39,9 @@
 import com.android.common.io.MoreCloseables;
 import com.android.contacts.common.database.NoNullCursorAsyncQueryHandler;
 
+import java.util.ArrayList;
+import java.util.List;
+
 /**
  * Helper class to listen for some magic character sequences
  * that are handled specially by the dialer.
@@ -80,20 +83,10 @@
     }
 
     public static boolean handleChars(Context context, String input, EditText textField) {
-        return handleChars(context, input, false, textField);
-    }
-
-    static boolean handleChars(Context context, String input) {
-        return handleChars(context, input, false, null);
-    }
-
-    static boolean handleChars(Context context, String input, boolean useSystemWindow,
-            EditText textField) {
-
         //get rid of the separators so that the string gets parsed correctly
         String dialString = PhoneNumberUtils.stripSeparators(input);
 
-        if (handleIMEIDisplay(context, dialString, useSystemWindow)
+        if (handleDeviceIdDisplay(context, dialString)
                 || handleRegulatoryInfoDisplay(context, dialString)
                 || handlePinEntry(context, dialString)
                 || handleAdnEntry(context, dialString, textField)
@@ -233,20 +226,30 @@
         return false;
     }
 
-    static boolean handleIMEIDisplay(Context context, String input, boolean useSystemWindow) {
+
+    // TODO: Use TelephonyCapabilities.getDeviceIdLabel() to get the device id label instead of a
+    // hard-coded string.
+    static boolean handleDeviceIdDisplay(Context context, String input) {
         TelephonyManager telephonyManager =
                 (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE);
-        if (telephonyManager != null && input.equals(MMI_IMEI_DISPLAY)) {
-            int phoneType = telephonyManager.getPhoneType();
-            if (phoneType == TelephonyManager.PHONE_TYPE_GSM) {
-                showIMEIPanel(context, useSystemWindow, telephonyManager);
-                return true;
-            } else if (phoneType == TelephonyManager.PHONE_TYPE_CDMA) {
-                showMEIDPanel(context, useSystemWindow, telephonyManager);
-                return true;
-            }
-        }
 
+        if (telephonyManager != null && input.equals(MMI_IMEI_DISPLAY)) {
+            int labelResId = (telephonyManager.getPhoneType() == TelephonyManager.PHONE_TYPE_GSM) ?
+                    R.string.imei : R.string.meid;
+
+            List<String> deviceIds = new ArrayList<String>();
+            for (int slot = 0; slot < telephonyManager.getPhoneCount(); slot++) {
+                deviceIds.add(telephonyManager.getDeviceId(slot));
+            }
+
+            AlertDialog alert = new AlertDialog.Builder(context)
+                    .setTitle(labelResId)
+                    .setItems(deviceIds.toArray(new String[deviceIds.size()]), null)
+                    .setPositiveButton(R.string.ok, null)
+                    .setCancelable(false)
+                    .show();
+            return true;
+        }
         return false;
     }
 
@@ -264,36 +267,6 @@
         return false;
     }
 
-    // TODO: Combine showIMEIPanel() and showMEIDPanel() into a single
-    // generic "showDeviceIdPanel()" method, like in the apps/Phone
-    // version of SpecialCharSequenceMgr.java.  (This will require moving
-    // the phone app's TelephonyCapabilities.getDeviceIdLabel() method
-    // into the telephony framework, though.)
-
-    private static void showIMEIPanel(Context context, boolean useSystemWindow,
-            TelephonyManager telephonyManager) {
-        String imeiStr = telephonyManager.getDeviceId();
-
-        AlertDialog alert = new AlertDialog.Builder(context)
-                .setTitle(R.string.imei)
-                .setMessage(imeiStr)
-                .setPositiveButton(android.R.string.ok, null)
-                .setCancelable(false)
-                .show();
-    }
-
-    private static void showMEIDPanel(Context context, boolean useSystemWindow,
-            TelephonyManager telephonyManager) {
-        String meidStr = telephonyManager.getDeviceId();
-
-        AlertDialog alert = new AlertDialog.Builder(context)
-                .setTitle(R.string.meid)
-                .setMessage(meidStr)
-                .setPositiveButton(android.R.string.ok, null)
-                .setCancelable(false)
-                .show();
-    }
-
     /*******
      * This code is used to handle SIM Contact queries
      *******/
diff --git a/src/com/android/dialer/calllog/CallLogAdapter.java b/src/com/android/dialer/calllog/CallLogAdapter.java
index dcd2de3..bd20d22 100644
--- a/src/com/android/dialer/calllog/CallLogAdapter.java
+++ b/src/com/android/dialer/calllog/CallLogAdapter.java
@@ -248,6 +248,8 @@
     private final ContactPhotoManager mContactPhotoManager;
     /** Helper to parse and process phone numbers. */
     private PhoneNumberDisplayHelper mPhoneNumberHelper;
+    /** Helper to access Telephony phone number utils class */
+    protected final PhoneNumberUtilsWrapper mPhoneNumberUtilsWrapper;
     /** Helper to group call log entries. */
     private final CallLogGroupBuilder mCallLogGroupBuilder;
 
@@ -365,9 +367,10 @@
         mExpandedTranslationZ = resources.getDimension(R.dimen.call_log_expanded_translation_z);
 
         mContactPhotoManager = ContactPhotoManager.getInstance(mContext);
-        mPhoneNumberHelper = new PhoneNumberDisplayHelper(resources);
-        PhoneCallDetailsHelper phoneCallDetailsHelper = new PhoneCallDetailsHelper(
-                resources, callTypeHelper, new PhoneNumberUtilsWrapper());
+        mPhoneNumberHelper = new PhoneNumberDisplayHelper(mContext, resources);
+        mPhoneNumberUtilsWrapper = new PhoneNumberUtilsWrapper(mContext);
+        PhoneCallDetailsHelper phoneCallDetailsHelper =
+                new PhoneCallDetailsHelper(mContext, resources, mPhoneNumberUtilsWrapper);
         mCallLogViewsHelper =
                 new CallLogListItemHelper(
                         phoneCallDetailsHelper, mPhoneNumberHelper, resources);
@@ -641,8 +644,6 @@
         final PhoneAccountHandle accountHandle = PhoneAccountUtils.getAccount(
                 c.getString(CallLogQuery.ACCOUNT_COMPONENT_NAME),
                 c.getString(CallLogQuery.ACCOUNT_ID));
-        final Drawable accountIcon = PhoneAccountUtils.getAccountIcon(mContext,
-                accountHandle);
         final String countryIso = c.getString(CallLogQuery.COUNTRY_ISO);
 
         final long rowId = c.getLong(CallLogQuery.ID);
@@ -668,7 +669,6 @@
         views.number = number;
         views.numberPresentation = numberPresentation;
         views.callType = callType;
-        // NOTE: This is currently not being used, but can be used in future versions.
         views.accountHandle = accountHandle;
         views.voicemailUri = c.getString(CallLogQuery.VOICEMAIL_URI);
         // Stash away the Ids of the calls so that we can support deleting a row in the call log.
@@ -677,7 +677,7 @@
         final ContactInfo cachedContactInfo = getContactInfoFromCallLog(c);
 
         final boolean isVoicemailNumber =
-                PhoneNumberUtilsWrapper.INSTANCE.isVoicemailNumber(number);
+                mPhoneNumberUtilsWrapper.isVoicemailNumber(accountHandle, number);
 
         // Where binding and not in the call log, use default behaviour of invoking a call when
         // tapping the primary view.
@@ -687,7 +687,13 @@
             // Set return call intent, otherwise null.
             if (PhoneNumberUtilsWrapper.canPlaceCallsTo(number, numberPresentation)) {
                 // Sets the primary action to call the number.
-                views.primaryActionView.setTag(IntentProvider.getReturnCallIntentProvider(number));
+                if (isVoicemailNumber) {
+                    views.primaryActionView.setTag(
+                            IntentProvider.getReturnVoicemailCallIntentProvider());
+                } else {
+                    views.primaryActionView.setTag(
+                            IntentProvider.getReturnCallIntentProvider(number));
+                }
             } else {
                 // Number is not callable, so hide button.
                 views.primaryActionView.setTag(null);
@@ -769,14 +775,13 @@
         expandOrCollapseActions(callLogItemView, isExpanded(rowId));
 
         if (TextUtils.isEmpty(name)) {
-            details = new PhoneCallDetails(number, numberPresentation,
-                    formattedNumber, countryIso, geocode, callTypes, date,
-                    duration, null, accountIcon, features, dataUsage, transcription);
+            details = new PhoneCallDetails(number, numberPresentation, formattedNumber, countryIso,
+                    geocode, callTypes, date, duration, accountHandle, features, dataUsage,
+                    transcription);
         } else {
-            details = new PhoneCallDetails(number, numberPresentation,
-                    formattedNumber, countryIso, geocode, callTypes, date,
-                    duration, name, ntype, label, lookupUri, photoUri, sourceType,
-                    null, accountIcon, features, dataUsage, transcription);
+            details = new PhoneCallDetails(number, numberPresentation, formattedNumber, countryIso,
+                    geocode, callTypes, date, duration, name, ntype, label, lookupUri, photoUri,
+                    sourceType, accountHandle, features, dataUsage, transcription);
         }
 
         mCallLogViewsHelper.setPhoneCallDetails(mContext, views, details);
@@ -794,8 +799,8 @@
 
         String nameForDefaultImage = null;
         if (TextUtils.isEmpty(name)) {
-            nameForDefaultImage = mPhoneNumberHelper.getDisplayNumber(details.number,
-                    details.numberPresentation, details.formattedNumber).toString();
+            nameForDefaultImage = mPhoneNumberHelper.getDisplayNumber(details.accountHandle,
+                    details.number, details.numberPresentation, details.formattedNumber).toString();
         } else {
             nameForDefaultImage = name;
         }
@@ -985,9 +990,18 @@
                 PhoneNumberUtilsWrapper.canPlaceCallsTo(views.number, views.numberPresentation);
         // Set return call intent, otherwise null.
         if (canPlaceCallToNumber) {
-            // Sets the primary action to call the number.
-            views.callBackButtonView.setTag(
-                    IntentProvider.getReturnCallIntentProvider(views.number));
+            boolean isVoicemailNumber =
+                    mPhoneNumberUtilsWrapper.isVoicemailNumber(views.accountHandle, views.number);
+            if (isVoicemailNumber) {
+                // Make a general call to voicemail to ensure that if there are multiple accounts
+                // it does not call the voicemail number of a specific phone account.
+                views.callBackButtonView.setTag(
+                        IntentProvider.getReturnVoicemailCallIntentProvider());
+            } else {
+                // Sets the primary action to call the number.
+                views.callBackButtonView.setTag(
+                        IntentProvider.getReturnCallIntentProvider(views.number));
+            }
             views.callBackButtonView.setVisibility(View.VISIBLE);
             views.callBackButtonView.setOnClickListener(mActionListener);
         } else {
diff --git a/src/com/android/dialer/calllog/CallLogListItemHelper.java b/src/com/android/dialer/calllog/CallLogListItemHelper.java
index 68ca7a8..1eb25fb 100644
--- a/src/com/android/dialer/calllog/CallLogListItemHelper.java
+++ b/src/com/android/dialer/calllog/CallLogListItemHelper.java
@@ -222,7 +222,7 @@
         if (!TextUtils.isEmpty(details.name)) {
             recipient = details.name;
         } else {
-            recipient = mPhoneNumberHelper.getDisplayNumber(
+            recipient = mPhoneNumberHelper.getDisplayNumber(details.accountHandle,
                     details.number, details.numberPresentation, details.formattedNumber);
         }
         return recipient;
diff --git a/src/com/android/dialer/calllog/DefaultVoicemailNotifier.java b/src/com/android/dialer/calllog/DefaultVoicemailNotifier.java
index 837cfba..970cad6 100644
--- a/src/com/android/dialer/calllog/DefaultVoicemailNotifier.java
+++ b/src/com/android/dialer/calllog/DefaultVoicemailNotifier.java
@@ -28,12 +28,14 @@
 import android.net.Uri;
 import android.provider.CallLog.Calls;
 import android.provider.ContactsContract.PhoneLookup;
+import android.telecom.PhoneAccountHandle;
 import android.text.TextUtils;
 import android.util.Log;
 
 import com.android.common.io.MoreCloseables;
 import com.android.dialer.CallDetailActivity;
 import com.android.dialer.R;
+import com.android.dialer.calllog.PhoneAccountUtils;
 import com.google.common.collect.Maps;
 
 import java.util.Map;
@@ -118,7 +120,10 @@
             // Check if we already know the name associated with this number.
             String name = names.get(newCall.number);
             if (name == null) {
-                name = mPhoneNumberHelper.getDisplayName(newCall.number,
+                PhoneAccountHandle accountHandle = PhoneAccountUtils.getAccount(
+                        newCall.accountComponentName,
+                        newCall.accountId);
+                name = mPhoneNumberHelper.getDisplayName(accountHandle, newCall.number,
                         newCall.numberPresentation).toString();
                 // If we cannot lookup the contact, use the number instead.
                 if (TextUtils.isEmpty(name)) {
@@ -214,13 +219,17 @@
         public final Uri voicemailUri;
         public final String number;
         public final int numberPresentation;
+        public final String accountComponentName;
+        public final String accountId;
 
         public NewCall(Uri callsUri, Uri voicemailUri, String number,
-                int numberPresentation) {
+                int numberPresentation, String accountComponentName, String accountId) {
             this.callsUri = callsUri;
             this.voicemailUri = voicemailUri;
             this.number = number;
             this.numberPresentation = numberPresentation;
+            this.accountComponentName = accountComponentName;
+            this.accountId = accountId;
         }
     }
 
@@ -243,12 +252,15 @@
      */
     private static final class DefaultNewCallsQuery implements NewCallsQuery {
         private static final String[] PROJECTION = {
-            Calls._ID, Calls.NUMBER, Calls.VOICEMAIL_URI, Calls.NUMBER_PRESENTATION
+            Calls._ID, Calls.NUMBER, Calls.VOICEMAIL_URI, Calls.NUMBER_PRESENTATION,
+            Calls.PHONE_ACCOUNT_COMPONENT_NAME, Calls.PHONE_ACCOUNT_ID
         };
         private static final int ID_COLUMN_INDEX = 0;
         private static final int NUMBER_COLUMN_INDEX = 1;
         private static final int VOICEMAIL_URI_COLUMN_INDEX = 2;
         private static final int NUMBER_PRESENTATION_COLUMN_INDEX = 3;
+        private static final int PHONE_ACCOUNT_COMPONENT_NAME_COLUMN_INDEX = 4;
+        private static final int PHONE_ACCOUNT_ID_COLUMN_INDEX = 5;
 
         private final ContentResolver mContentResolver;
 
@@ -284,7 +296,9 @@
                     Calls.CONTENT_URI_WITH_VOICEMAIL, cursor.getLong(ID_COLUMN_INDEX));
             Uri voicemailUri = voicemailUriString == null ? null : Uri.parse(voicemailUriString);
             return new NewCall(callsUri, voicemailUri, cursor.getString(NUMBER_COLUMN_INDEX),
-                    cursor.getInt(NUMBER_PRESENTATION_COLUMN_INDEX));
+                    cursor.getInt(NUMBER_PRESENTATION_COLUMN_INDEX),
+                    cursor.getString(PHONE_ACCOUNT_COMPONENT_NAME_COLUMN_INDEX),
+                    cursor.getString(PHONE_ACCOUNT_ID_COLUMN_INDEX));
         }
     }
 
@@ -343,6 +357,6 @@
      * called from the main thread.
      */
     public static PhoneNumberDisplayHelper createPhoneNumberHelper(Context context) {
-        return new PhoneNumberDisplayHelper(context.getResources());
+        return new PhoneNumberDisplayHelper(context, context.getResources());
     }
 }
diff --git a/src/com/android/dialer/calllog/IntentProvider.java b/src/com/android/dialer/calllog/IntentProvider.java
index 874d4ca..3084e24 100644
--- a/src/com/android/dialer/calllog/IntentProvider.java
+++ b/src/com/android/dialer/calllog/IntentProvider.java
@@ -65,6 +65,15 @@
         };
     }
 
+    public static IntentProvider getReturnVoicemailCallIntentProvider() {
+        return new IntentProvider() {
+            @Override
+            public Intent getIntent(Context context) {
+                return CallUtil.getVoicemailIntent();
+            }
+        };
+    }
+
     public static IntentProvider getPlayVoicemailIntentProvider(final long rowId,
             final String voicemailUri) {
         return new IntentProvider() {
diff --git a/src/com/android/dialer/calllog/PhoneAccountUtils.java b/src/com/android/dialer/calllog/PhoneAccountUtils.java
index d716aee..20b81d8 100644
--- a/src/com/android/dialer/calllog/PhoneAccountUtils.java
+++ b/src/com/android/dialer/calllog/PhoneAccountUtils.java
@@ -29,10 +29,9 @@
  */
 public class PhoneAccountUtils {
     /**
-     * Generate account info from data in Telecomm database
+     * Compose PhoneAccount object from component name and account id
      */
-    public static PhoneAccountHandle getAccount(String componentString,
-            String accountId) {
+    public static PhoneAccountHandle getAccount(String componentString, String accountId) {
         if (TextUtils.isEmpty(componentString) || TextUtils.isEmpty(accountId)) {
             return null;
         }
@@ -41,7 +40,7 @@
     }
 
     /**
-     * Generate account icon from data in Telecomm database
+     * Extract account icon from PhoneAccount object
      */
     public static Drawable getAccountIcon(Context context, PhoneAccountHandle phoneAccount) {
         final PhoneAccount account = getAccountOrNull(context, phoneAccount);
@@ -52,7 +51,7 @@
     }
 
     /**
-     * Generate account label from data in Telecomm database
+     * Extract account label from PhoneAccount object
      */
     public static String getAccountLabel(Context context, PhoneAccountHandle phoneAccount) {
         final PhoneAccount account = getAccountOrNull(context, phoneAccount);
@@ -66,8 +65,7 @@
      * Retrieve the account metadata, but if the account does not exist or the device has only a
      * single registered and enabled account, return null.
      */
-    private static PhoneAccount getAccountOrNull(Context context,
-            PhoneAccountHandle phoneAccount) {
+    private static PhoneAccount getAccountOrNull(Context context, PhoneAccountHandle phoneAccount) {
         final TelecomManager telecomManager =
                 (TelecomManager) context.getSystemService(Context.TELECOM_SERVICE);
         final PhoneAccount account = telecomManager.getPhoneAccount(phoneAccount);
diff --git a/src/com/android/dialer/calllog/PhoneNumberDisplayHelper.java b/src/com/android/dialer/calllog/PhoneNumberDisplayHelper.java
index 5d7ce7e..0dffd86 100644
--- a/src/com/android/dialer/calllog/PhoneNumberDisplayHelper.java
+++ b/src/com/android/dialer/calllog/PhoneNumberDisplayHelper.java
@@ -16,8 +16,10 @@
 
 package com.android.dialer.calllog;
 
+import android.content.Context;
 import android.content.res.Resources;
 import android.provider.CallLog.Calls;
+import android.telecom.PhoneAccountHandle;
 import android.text.TextUtils;
 import android.util.Log;
 
@@ -27,20 +29,25 @@
  * Helper for formatting and managing the display of phone numbers.
  */
 public class PhoneNumberDisplayHelper {
-    private final PhoneNumberUtilsWrapper mPhoneNumberUtils;
+    private final Context mContext;
     private final Resources mResources;
+    private final PhoneNumberUtilsWrapper mPhoneNumberUtilsWrapper;
 
-    public PhoneNumberDisplayHelper(Resources resources) {
+    public PhoneNumberDisplayHelper(Context context, Resources resources) {
+        mContext = context;
         mResources = resources;
-        mPhoneNumberUtils = new PhoneNumberUtilsWrapper();
+        mPhoneNumberUtilsWrapper = new PhoneNumberUtilsWrapper(context);
     }
 
-    public PhoneNumberDisplayHelper(PhoneNumberUtilsWrapper phoneNumberUtils, Resources resources) {
-        mPhoneNumberUtils = phoneNumberUtils;
+    public PhoneNumberDisplayHelper(Context context, Resources resources,
+            PhoneNumberUtilsWrapper phoneNumberUtils) {
+        mContext = context;
         mResources = resources;
+        mPhoneNumberUtilsWrapper = phoneNumberUtils;
     }
 
-    /* package */ CharSequence getDisplayName(CharSequence number, int presentation) {
+    /* package */ CharSequence getDisplayName(PhoneAccountHandle accountHandle, CharSequence number,
+            int presentation) {
         if (presentation == Calls.PRESENTATION_UNKNOWN) {
             return mResources.getString(R.string.unknown);
         }
@@ -50,7 +57,7 @@
         if (presentation == Calls.PRESENTATION_PAYPHONE) {
             return mResources.getString(R.string.payphone);
         }
-        if (mPhoneNumberUtils.isVoicemailNumber(number)) {
+        if (mPhoneNumberUtilsWrapper.isVoicemailNumber(accountHandle, number)) {
             return mResources.getString(R.string.voicemail);
         }
         if (PhoneNumberUtilsWrapper.isLegacyUnknownNumbers(number)) {
@@ -62,13 +69,14 @@
     /**
      * Returns the string to display for the given phone number.
      *
+     * @param accountHandle The handle for the account corresponding to the call
      * @param number the number to display
      * @param formattedNumber the formatted number if available, may be null
      */
-    public CharSequence getDisplayNumber(CharSequence number,
+    public CharSequence getDisplayNumber(PhoneAccountHandle accountHandle, CharSequence number,
             int presentation, CharSequence formattedNumber) {
 
-        final CharSequence displayName = getDisplayName(number, presentation);
+        final CharSequence displayName = getDisplayName(accountHandle, number, presentation);
         if (!TextUtils.isEmpty(displayName)) {
             return displayName;
         }
diff --git a/src/com/android/dialer/calllog/PhoneNumberUtilsWrapper.java b/src/com/android/dialer/calllog/PhoneNumberUtilsWrapper.java
index 00a260a..11f4a67 100644
--- a/src/com/android/dialer/calllog/PhoneNumberUtilsWrapper.java
+++ b/src/com/android/dialer/calllog/PhoneNumberUtilsWrapper.java
@@ -16,7 +16,10 @@
 
 package com.android.dialer.calllog;
 
+import android.content.Context;
 import android.provider.CallLog;
+import android.telecom.PhoneAccountHandle;
+import android.telecom.TelecomManager;
 import android.telephony.PhoneNumberUtils;
 import android.text.TextUtils;
 
@@ -30,8 +33,12 @@
  *
  */
 public class PhoneNumberUtilsWrapper {
-    public static final PhoneNumberUtilsWrapper INSTANCE = new PhoneNumberUtilsWrapper();
     private static final Set<String> LEGACY_UNKNOWN_NUMBERS = Sets.newHashSet("-1", "-2", "-3");
+    private final Context mContext;
+
+    public PhoneNumberUtilsWrapper(Context context) {
+        mContext = context;
+    }
 
     /** Returns true if it is possible to place a call to the given number. */
     public static boolean canPlaceCallsTo(CharSequence number, int presentation) {
@@ -40,30 +47,26 @@
     }
 
     /**
-     * Returns true if it is possible to send an SMS to the given number.
-     */
-    public boolean canSendSmsTo(CharSequence number, int presentation) {
-        return canPlaceCallsTo(number, presentation) && !isVoicemailNumber(number) && !isSipNumber(
-                number);
-    }
-
-    /**
      * Returns true if the given number is the number of the configured voicemail. To be able to
      * mock-out this, it is not a static method.
      */
-    public boolean isVoicemailNumber(CharSequence number) {
-        return number!= null && PhoneNumberUtils.isVoiceMailNumber(number.toString());
+    public boolean isVoicemailNumber(PhoneAccountHandle accountHandle,
+            CharSequence number) {
+        final TelecomManager telecomManager =
+                (TelecomManager) mContext.getSystemService(Context.TELECOM_SERVICE);
+        return number!= null && telecomManager.isVoiceMailNumber(accountHandle, number.toString());
     }
 
     /**
      * Returns true if the given number is a SIP address. To be able to mock-out this, it is not a
      * static method.
      */
-    public boolean isSipNumber(CharSequence number) {
+    public static boolean isSipNumber(CharSequence number) {
         return number != null && PhoneNumberHelper.isUriNumber(number.toString());
     }
 
-    public static boolean isUnknownNumberThatCanBeLookedUp(CharSequence number, int presentation) {
+    public boolean isUnknownNumberThatCanBeLookedUp(PhoneAccountHandle accountHandle,
+            CharSequence number, int presentation) {
         if (presentation == CallLog.Calls.PRESENTATION_UNKNOWN) {
             return false;
         }
@@ -76,7 +79,7 @@
         if (TextUtils.isEmpty(number)) {
             return false;
         }
-        if (INSTANCE.isVoicemailNumber(number)) {
+        if (isVoicemailNumber(accountHandle, number)) {
             return false;
         }
         if (isLegacyUnknownNumbers(number)) {
diff --git a/src/com/android/dialer/dialpad/DialpadFragment.java b/src/com/android/dialer/dialpad/DialpadFragment.java
index 7faed07..c83a16c 100644
--- a/src/com/android/dialer/dialpad/DialpadFragment.java
+++ b/src/com/android/dialer/dialpad/DialpadFragment.java
@@ -255,13 +255,6 @@
 
     private static final String PREF_DIGITS_FILLED_BY_INTENT = "pref_digits_filled_by_intent";
 
-    /**
-     * Return an Intent for launching voicemail screen.
-     */
-    private static Intent getVoicemailIntent() {
-        return CallUtil.getCallIntent(Uri.fromParts(PhoneAccount.SCHEME_VOICEMAIL, "", null));
-    }
-
     private TelephonyManager getTelephonyManager() {
         return (TelephonyManager) getActivity().getSystemService(Context.TELEPHONY_SERVICE);
     }
@@ -974,7 +967,7 @@
     }
 
     public void callVoicemail() {
-        DialerUtils.startActivityWithErrorToast(getActivity(), getVoicemailIntent());
+        DialerUtils.startActivityWithErrorToast(getActivity(), CallUtil.getVoicemailIntent());
         hideAndClearDialpad(false);
     }
 
diff --git a/tests/src/com/android/dialer/PhoneCallDetailsHelperTest.java b/tests/src/com/android/dialer/PhoneCallDetailsHelperTest.java
index bc7c033..7ae2c22 100644
--- a/tests/src/com/android/dialer/PhoneCallDetailsHelperTest.java
+++ b/tests/src/com/android/dialer/PhoneCallDetailsHelperTest.java
@@ -25,7 +25,6 @@
 import android.view.View;
 import android.widget.TextView;
 
-import com.android.dialer.calllog.CallTypeHelper;
 import com.android.dialer.calllog.TestPhoneNumberUtilsWrapper;
 import com.android.dialer.util.LocaleTestUtils;
 
@@ -60,16 +59,17 @@
     private PhoneCallDetailsViews mViews;
     private TextView mNameView;
     private LocaleTestUtils mLocaleTestUtils;
+    private TestPhoneNumberUtilsWrapper mPhoneUtils;
 
     @Override
     protected void setUp() throws Exception {
         super.setUp();
         Context context = getContext();
         Resources resources = context.getResources();
-        CallTypeHelper callTypeHelper = new CallTypeHelper(resources);
+        mPhoneUtils = new TestPhoneNumberUtilsWrapper(context, TEST_VOICEMAIL_NUMBER);
         final TestPhoneNumberUtilsWrapper phoneUtils = new TestPhoneNumberUtilsWrapper(
-                TEST_VOICEMAIL_NUMBER);
-        mHelper = new PhoneCallDetailsHelper(resources, callTypeHelper, phoneUtils);
+                context, TEST_VOICEMAIL_NUMBER);
+        mHelper = new PhoneCallDetailsHelper(context, resources, phoneUtils);
         mHelper.setCurrentTimeForTest(
                 new GregorianCalendar(2011, 5, 4, 13, 0, 0).getTimeInMillis());
         mViews = PhoneCallDetailsViews.createForTest(context);
@@ -311,8 +311,7 @@
         mHelper.setPhoneCallDetails(mViews,
                 new PhoneCallDetails(number, presentation, formattedNumber,
                         TEST_COUNTRY_ISO, TEST_GEOCODE,
-                        new int[]{ Calls.VOICEMAIL_TYPE }, TEST_DATE, TEST_DURATION, null, null, 0,
-                        null, null)
+                        new int[]{ Calls.VOICEMAIL_TYPE }, TEST_DATE, TEST_DURATION)
         );
     }
 
@@ -322,8 +321,7 @@
         mHelper.setPhoneCallDetails(mViews,
                 new PhoneCallDetails(number, Calls.PRESENTATION_ALLOWED,
                         formattedNumber, TEST_COUNTRY_ISO, geocodedLocation,
-                        new int[]{ Calls.VOICEMAIL_TYPE }, TEST_DATE, TEST_DURATION, null, null, 0,
-                        null, null)
+                        new int[]{ Calls.VOICEMAIL_TYPE }, TEST_DATE, TEST_DURATION)
         );
     }
 
@@ -352,7 +350,7 @@
         mHelper.setPhoneCallDetails(mViews,
                 new PhoneCallDetails(TEST_NUMBER, Calls.PRESENTATION_ALLOWED,
                         TEST_FORMATTED_NUMBER, TEST_COUNTRY_ISO, TEST_GEOCODE,
-                        new int[]{ Calls.INCOMING_TYPE }, TEST_DATE, TEST_DURATION, null, null,
+                        new int[]{ Calls.INCOMING_TYPE }, TEST_DATE, TEST_DURATION, null,
                         features, null, null)
         );
     }
@@ -361,8 +359,8 @@
         mHelper.setCallDetailsHeader(mNameView,
                 new PhoneCallDetails(number, presentation,
                         TEST_FORMATTED_NUMBER, TEST_COUNTRY_ISO, TEST_GEOCODE,
-                        new int[]{ Calls.INCOMING_TYPE }, TEST_DATE, TEST_DURATION, null, null, 0,
-                        null, null));
+                        new int[]{ Calls.INCOMING_TYPE }, TEST_DATE, TEST_DURATION, null,
+                        0, null, null));
     }
 
     private void setCallDetailsHeader(String name) {
@@ -370,6 +368,6 @@
                 new PhoneCallDetails(TEST_NUMBER, Calls.PRESENTATION_ALLOWED,
                         TEST_FORMATTED_NUMBER, TEST_COUNTRY_ISO, TEST_GEOCODE,
                         new int[]{ Calls.INCOMING_TYPE }, TEST_DATE, TEST_DURATION,
-                        name, 0, "", null, null, 0, null, null, 0, null, null));
+                        name, 0, "", null, null, 0, null, 0, null, null));
     }
 }
diff --git a/tests/src/com/android/dialer/calllog/CallLogListItemHelperTest.java b/tests/src/com/android/dialer/calllog/CallLogListItemHelperTest.java
index 85dbf8c..c0347cf 100644
--- a/tests/src/com/android/dialer/calllog/CallLogListItemHelperTest.java
+++ b/tests/src/com/android/dialer/calllog/CallLogListItemHelperTest.java
@@ -60,12 +60,11 @@
         super.setUp();
         Context context = getContext();
         mResources = context.getResources();
-        CallTypeHelper callTypeHelper = new CallTypeHelper(mResources);
-        final TestPhoneNumberUtilsWrapper phoneUtils = new TestPhoneNumberUtilsWrapper(
-                TEST_VOICEMAIL_NUMBER);
-        PhoneCallDetailsHelper phoneCallDetailsHelper = new PhoneCallDetailsHelper(
-                mResources, callTypeHelper, phoneUtils);
-        mPhoneNumberDisplayHelper = new PhoneNumberDisplayHelper(mResources);
+        final TestPhoneNumberUtilsWrapper phoneUtils =
+                new TestPhoneNumberUtilsWrapper(context, TEST_VOICEMAIL_NUMBER);
+        PhoneCallDetailsHelper phoneCallDetailsHelper =
+                new PhoneCallDetailsHelper(context, mResources, phoneUtils);
+        mPhoneNumberDisplayHelper = new PhoneNumberDisplayHelper(context, mResources, phoneUtils);
         mHelper = new CallLogListItemHelper(phoneCallDetailsHelper, mPhoneNumberDisplayHelper,
                 mResources);
         mViews = CallLogListItemViews.createForTest(context);
@@ -319,10 +318,9 @@
      */
     public void testGetCallDescription_Video() {
         PhoneCallDetails details = new PhoneCallDetails(TEST_NUMBER, Calls.PRESENTATION_ALLOWED,
-                TEST_FORMATTED_NUMBER,
-                TEST_COUNTRY_ISO, TEST_GEOCODE,
+                TEST_FORMATTED_NUMBER, TEST_COUNTRY_ISO, TEST_GEOCODE,
                 new int[]{Calls.INCOMING_TYPE, Calls.INCOMING_TYPE}, TEST_DATE, TEST_DURATION,
-                null, null, Calls.FEATURES_VIDEO, null, null);
+                null, Calls.FEATURES_VIDEO, null, null);
 
         CharSequence description = mHelper.getCallDescription(getContext(), details);
         assertTrue(description.toString()
diff --git a/tests/src/com/android/dialer/calllog/TestPhoneNumberUtilsWrapper.java b/tests/src/com/android/dialer/calllog/TestPhoneNumberUtilsWrapper.java
index 7266d88..24916db 100644
--- a/tests/src/com/android/dialer/calllog/TestPhoneNumberUtilsWrapper.java
+++ b/tests/src/com/android/dialer/calllog/TestPhoneNumberUtilsWrapper.java
@@ -16,19 +16,23 @@
 
 package com.android.dialer.calllog;
 
+import android.content.Context;
+import android.telecom.PhoneAccountHandle;
+
 /**
- * Modified version of {@link com.android.dialer.calllog.PhoneNumberDisplayHelper} to be used in tests
- * that allows injecting the voicemail number.
+ * Modified version of {@link com.android.dialer.calllog.PhoneNumberDisplayHelper} to be used in
+ * tests that allows injecting the voicemail number.
  */
 public final class TestPhoneNumberUtilsWrapper extends PhoneNumberUtilsWrapper {
     private CharSequence mVoicemailNumber;
 
-    public TestPhoneNumberUtilsWrapper(CharSequence voicemailNumber) {
+    public TestPhoneNumberUtilsWrapper(Context context, CharSequence voicemailNumber) {
+        super(context);
         mVoicemailNumber = voicemailNumber;
     }
 
     @Override
-    public boolean isVoicemailNumber(CharSequence number) {
+    public boolean isVoicemailNumber(PhoneAccountHandle accountHandle, CharSequence number) {
         return mVoicemailNumber.equals(number);
     }
 }