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

Commit 5da55ff8 authored by Wenyi Wang's avatar Wenyi Wang
Browse files

Correct Talkback announcement of SMS shortcut on Quick Contact

Bug: 25794705
Change-Id: Ifd39d3cb88c1b27710fb307ca95949df17ee5d91
parent a4225bcf
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -108,7 +108,7 @@ public class ExpandingEntryCardView extends CardView {
        private final Intent mIntent;
        private final Drawable mAlternateIcon;
        private final Intent mAlternateIntent;
        private final String mAlternateContentDescription;
        private Spannable mAlternateContentDescription;
        private final boolean mShouldApplyColor;
        private final boolean mIsEditable;
        private final EntryContextMenuInfo mEntryContextMenuInfo;
@@ -122,8 +122,8 @@ public class ExpandingEntryCardView extends CardView {
        public Entry(int id, Drawable mainIcon, String header, String subHeader,
                Drawable subHeaderIcon, String text, Drawable textIcon,
                Spannable primaryContentDescription, Intent intent,
                Drawable alternateIcon, Intent alternateIntent, String alternateContentDescription,
                boolean shouldApplyColor, boolean isEditable,
                Drawable alternateIcon, Intent alternateIntent,
                Spannable alternateContentDescription, boolean shouldApplyColor, boolean isEditable,
                EntryContextMenuInfo entryContextMenuInfo, Drawable thirdIcon, Intent thirdIntent,
                String thirdContentDescription, int thirdAction, Bundle thirdExtras,
                int iconResourceId) {
@@ -190,7 +190,7 @@ public class ExpandingEntryCardView extends CardView {
            return mAlternateIntent;
        }

        String getAlternateContentDescription() {
        Spannable getAlternateContentDescription() {
            return mAlternateContentDescription;
        }

+7 −1
Original line number Diff line number Diff line
@@ -1700,6 +1700,7 @@ public class QuickContactActivity extends ContactsActivity
        Drawable textIcon = null;
        StringBuilder primaryContentDescription = new StringBuilder();
        Spannable phoneContentDescription = null;
        Spannable smsContentDescription = null;
        Intent intent = null;
        boolean shouldApplyColor = true;
        Drawable alternateIcon = null;
@@ -1857,6 +1858,8 @@ public class QuickContactActivity extends ContactsActivity

                alternateIcon = res.getDrawable(R.drawable.ic_message_24dp);
                alternateContentDescription.append(res.getString(R.string.sms_custom, header));
                smsContentDescription = com.android.contacts.common.util.ContactDisplayUtils
                        .getTelephoneTtsSpannable(alternateContentDescription.toString(), header);

                if (CallUtil.isCallWithSubjectSupported(context)) {
                    thirdIcon = res.getDrawable(R.drawable.ic_call_note_white_24dp);
@@ -2082,7 +2085,10 @@ public class QuickContactActivity extends ContactsActivity
                        ? new SpannableString(primaryContentDescription.toString())
                        : phoneContentDescription,
                intent, alternateIcon, alternateIntent,
                alternateContentDescription.toString(), shouldApplyColor, isEditable,
                smsContentDescription == null
                        ? new SpannableString(alternateContentDescription.toString())
                        : smsContentDescription,
                shouldApplyColor, isEditable,
                entryContextMenuInfo, thirdIcon, thirdIntent, thirdContentDescription, thirdAction,
                thirdExtras, iconResourceId);
    }