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

Commit ef0bb49a authored by Tingting Wang's avatar Tingting Wang Committed by Android (Google) Code Review
Browse files

Merge "Fix bugs when reading phone number in talkback mode." into ub-contactsdialer-a-dev

parents ce0413b7 b6949dc7
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -20,6 +20,8 @@ import android.content.Context;
import android.graphics.Rect;
import android.os.Parcel;
import android.os.Parcelable;
import android.provider.ContactsContract;
import android.telephony.PhoneNumberUtils;
import android.text.Editable;
import android.text.InputType;
import android.text.TextUtils;
@@ -251,7 +253,11 @@ public class TextFieldsEditorView extends LabeledEditorView {
            // Read current value from state
            final String column = field.column;
            final String value = entry.getAsString(column);
            if (ContactsContract.CommonDataKinds.Phone.CONTENT_ITEM_TYPE.equals(kind.mimeType)) {
                fieldView.setText(PhoneNumberUtils.createTtsSpannable(value));
            } else {
                fieldView.setText(value);
            }

            // Show the delete button if we have a non-null value
            setDeleteButtonVisible(value != null);
+7 −1
Original line number Diff line number Diff line
@@ -72,6 +72,7 @@ import android.support.v7.widget.CardView;
import android.telecom.PhoneAccount;
import android.telecom.TelecomManager;
import android.text.BidiFormatter;
import android.text.Spannable;
import android.text.SpannableString;
import android.text.TextDirectionHeuristics;
import android.text.TextUtils;
@@ -1700,6 +1701,7 @@ public class QuickContactActivity extends ContactsActivity
        String text = null;
        Drawable textIcon = null;
        StringBuilder primaryContentDescription = new StringBuilder();
        Spannable phoneContentDescription = null;
        Intent intent = null;
        boolean shouldApplyColor = true;
        Drawable alternateIcon = null;
@@ -1845,6 +1847,8 @@ public class QuickContactActivity extends ContactsActivity
                    }
                }
                primaryContentDescription.append(header);
                phoneContentDescription = com.android.contacts.common.util.ContactDisplayUtils
                        .getTelephoneTtsSpannable(primaryContentDescription.toString(), header);
                icon = res.getDrawable(R.drawable.ic_phone_24dp);
                iconResourceId = R.drawable.ic_phone_24dp;
                if (PhoneCapabilityTester.isPhone(context)) {
@@ -2076,7 +2080,9 @@ public class QuickContactActivity extends ContactsActivity
                -1 : (int) dataItem.getId();

        return new Entry(dataId, icon, header, subHeader, subHeaderIcon, text, textIcon,
                new SpannableString(primaryContentDescription.toString()),
                phoneContentDescription == null
                        ? new SpannableString(primaryContentDescription.toString())
                        : phoneContentDescription,
                intent, alternateIcon, alternateIntent,
                alternateContentDescription.toString(), shouldApplyColor, isEditable,
                entryContextMenuInfo, thirdIcon, thirdIntent, thirdContentDescription, thirdAction,