Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 62cfa6e5 authored by Brandon Maxwell's avatar Brandon Maxwell
Browse files

Using Compat code for createTtsSpannable

Bug:25776171
Change-Id: I04f9f08a5e032751c35a9a8c0e0d4b390d3843c3
parent 92e43c3d
Loading
Loading
Loading
Loading
+5 −7
Original line number Diff line number Diff line
@@ -16,16 +16,14 @@

package com.android.contacts.common.compat;

import android.os.Build;
import android.text.Spannable;
import android.text.style.TtsSpan;
import android.telephony.PhoneNumberUtils;

import com.google.i18n.phonenumbers.NumberParseException;
import com.google.i18n.phonenumbers.PhoneNumberUtil;
import com.google.i18n.phonenumbers.PhoneNumberUtil.PhoneNumberFormat;
import com.google.i18n.phonenumbers.Phonenumber.PhoneNumber;
import com.google.i18n.phonenumbers.ShortNumberUtil;

import android.os.Build;
import android.telephony.PhoneNumberUtils;
import android.text.Spannable;
import android.text.style.TtsSpan;

/**
 * This class contains static utility methods extracted from PhoneNumberUtils, and the
+2 −2
Original line number Diff line number Diff line
@@ -29,7 +29,6 @@ import android.database.Cursor;
import android.net.Uri;
import android.os.Bundle;
import android.provider.ContactsContract.Contacts;
import android.telephony.PhoneNumberUtils;
import android.telephony.SubscriptionInfo;
import android.telephony.SubscriptionManager;
import android.telephony.TelephonyManager;
@@ -43,6 +42,7 @@ import android.widget.TextView;
import android.widget.Toast;

import com.android.contacts.common.R;
import com.android.contacts.common.compat.PhoneNumberUtilsCompat;
import com.android.contacts.common.editor.SelectAccountDialogFragment;
import com.android.contacts.common.model.AccountTypeManager;
import com.android.contacts.common.model.account.AccountWithDataSet;
@@ -320,7 +320,7 @@ public class ImportExportDialogFragment extends DialogFragment
        return TextUtils.expandTemplate(
                getString(R.string.import_from_sim_summary),
                name,
                PhoneNumberUtils.createTtsSpannable(record.getNumber()));
                PhoneNumberUtilsCompat.createTtsSpannable(record.getNumber()));
    }

    private static class AdapterEntry {
+4 −4
Original line number Diff line number Diff line
@@ -16,8 +16,6 @@

package com.android.contacts.common.widget;

import android.telecom.PhoneAccount;
import android.telecom.PhoneAccountHandle;
import android.app.AlertDialog;
import android.app.Dialog;
import android.app.DialogFragment;
@@ -26,8 +24,9 @@ import android.content.DialogInterface;
import android.os.Bundle;
import android.os.Handler;
import android.os.ResultReceiver;
import android.telecom.PhoneAccount;
import android.telecom.PhoneAccountHandle;
import android.telecom.TelecomManager;
import android.telephony.PhoneNumberUtils;
import android.text.TextUtils;
import android.view.LayoutInflater;
import android.view.View;
@@ -41,6 +40,7 @@ import android.widget.ListAdapter;
import android.widget.TextView;

import com.android.contacts.common.R;
import com.android.contacts.common.compat.PhoneNumberUtilsCompat;

import java.util.ArrayList;
import java.util.List;
@@ -254,7 +254,7 @@ public class SelectPhoneAccountDialogFragment extends DialogFragment {
            } else {
                holder.numberTextView.setVisibility(View.VISIBLE);
                holder.numberTextView.setText(
                        PhoneNumberUtils.createTtsSpannable(
                        PhoneNumberUtilsCompat.createTtsSpannable(
                                account.getAddress().getSchemeSpecificPart()));
            }
            holder.imageView.setImageDrawable(account.getIcon() != null