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

Commit 8a3fe528 authored by Walter Jang's avatar Walter Jang
Browse files

Sms and call log entry content description string fixes

* This is incremental work to fixing TalkBack for
  all phone number Strings
* Date was being added twice to the call log content
  description string
* Use xliff tags for all parts of both the sms and call log
  content description strings
* Removed an unnecessary ExpandingEntryCardView constructor

Bug 17322140

Change-Id: Iccc39dad5dcc3fc7f8079de439b07d306b6c24e3
parent 9a47c576
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -710,7 +710,7 @@
    <string name="content_description_directions">directions to location</string>

    <!-- Content description for recent sms interaction [CHAR LIMIT=NONE] -->
    <string name="content_description_recent_sms">recent sms. <xliff:g id="message_details">%s</xliff:g>. click to respond</string>
    <string name="content_description_recent_sms">recent sms. <xliff:g id="message_body">%s</xliff:g>. <xliff:g id="phone_number">%s</xliff:g>. <xliff:g id="date">%s</xliff:g>. click to respond</string>

    <!-- Header for the Relation entry [CHAR LIMIT=NONE] -->
    <string name="content_description_recent_call_type_incoming">incoming</string>
@@ -720,7 +720,7 @@
    <string name="content_description_recent_call_type_missed">missed</string>

    <!-- Content description for recent sms interaction [CHAR LIMIT=NONE] -->
    <string name="content_description_recent_call">recent call. <xliff:g id="call_details">%s</xliff:g>. click to call back</string>
    <string name="content_description_recent_call">recent call. <xliff:g id="call_type">%s</xliff:g>. <xliff:g id="phone_number">%s</xliff:g>. <xliff:g id="date">%s</xliff:g>. click to call back</string>

    <!-- Prefix for messages that you sent [CHAR LIMIT=40] -->
    <string name="message_from_you_prefix">You: <xliff:g id="sms_body">%s</xliff:g></string>
+1 −3
Original line number Diff line number Diff line
@@ -180,10 +180,8 @@ public class CallLogInteraction implements ContactInteraction {

    @Override
    public String getContentDescription(Context context) {
        String callDetails = getCallTypeString(context) + ". " + getViewFooter(context) + ". " +
                getViewHeader(context) + ". " + getViewFooter(context);
        return context.getResources().getString(R.string.content_description_recent_call,
                callDetails);
                getCallTypeString(context), getViewHeader(context), getViewFooter(context));
    }

    private String getCallTypeString(Context context) {
+2 −0
Original line number Diff line number Diff line
@@ -103,6 +103,8 @@ public class CallLogInteractionsLoader extends AsyncTaskLoader<List<ContactInter
    }

    private List<ContactInteraction> getCallLogInteractions(String phoneNumber) {
        // TODO: the phone number added to the ContactInteractions result should retain their
        // original formatting since TalkBack is not reading the normalized number correctly
        final String normalizedNumber = PhoneNumberUtils.normalizeNumber(phoneNumber);
        // If the number contains only symbols, we can skip it
        if (TextUtils.isEmpty(normalizedNumber)) {
+1 −3
Original line number Diff line number Diff line
@@ -160,10 +160,8 @@ public class SmsInteraction implements ContactInteraction {

    @Override
    public String getContentDescription(Context context) {
        String messageDetails = getViewHeader(context) + ". " + getViewBody(context) + ". " +
                getViewFooter(context);
        return context.getResources().getString(R.string.content_description_recent_sms,
                messageDetails);
                getViewHeader(context), getViewBody(context), getViewFooter(context));
    }

    @Override
+2 −0
Original line number Diff line number Diff line
@@ -66,6 +66,8 @@ public class SmsInteractionsLoader extends AsyncTaskLoader<List<ContactInteracti
        // Retrieve the thread IDs
        List<String> threadIdStrings = new ArrayList<>();
        for (String phone : mPhoneNums) {
            // TODO: the phone numbers added to the ContactInteraction result should retain their
            // original formatting since TalkBack is not reading the normalized numbers correctly
            try {
                threadIdStrings.add(String.valueOf(
                        Telephony.Threads.getOrCreateThreadId(getContext(), phone)));
Loading