Update contentDescription to announce 'than' rather than '>'

Root Cause: Talkback announce '>' (greater than), which is not user expected.

Solution: Update contentDescription with string contain 'than'

Bug: 378804585
Test: Enable screen reader to check
Flag: EXEMPT bugfix
Change-Id: Ibc7a2f7c7d1100dd25ddf29c2fffb22ac5ad52c6
This commit is contained in:
jasonwshsu
2024-12-17 20:51:55 +08:00
parent 597b3c6480
commit 7bb0c30688
2 changed files with 18 additions and 0 deletions

View File

@@ -5672,6 +5672,8 @@
<string name="accessibility_hearing_device_about_title">About hearing devices</string>
<!-- Description for text in accessibility hearing aids footer. [CHAR LIMIT=NONE BACKUP_MESSAGE_ID=7451899224828040581] -->
<string name="accessibility_hearing_device_footer_summary">To find other hearing devices that arent supported by ASHA or LE Audio, tap <b>Pair new device</b> > <b>See more devices</b></string>
<!-- Description for text in accessibility hearing aids footer. Replace '>' to 'then' for TTS to announce. [CHAR LIMIT=NONE BACKUP_MESSAGE_ID=7451899224828040581] -->
<string name="accessibility_hearing_device_footer_summary_tts">To find other hearing devices that arent supported by ASHA or LE Audio, tap <b>Pair new device</b> then <b>See more devices</b></string>
<!-- Title for the pair hearing device page. [CHAR LIMIT=25] -->
<string name="accessibility_hearing_device_pairing_page_title">Pair hearing device</string>
<!-- Subtitle for the pair hearing device page. [CHAR LIMIT=NONE] -->

View File

@@ -18,6 +18,9 @@ package com.android.settings.accessibility;
import android.content.Context;
import androidx.annotation.NonNull;
import androidx.preference.PreferenceScreen;
import com.android.settings.R;
/** Preference controller for footer in hearing device page. */
@@ -32,4 +35,17 @@ public class HearingDeviceFooterPreferenceController extends
protected String getIntroductionTitle() {
return mContext.getString(R.string.accessibility_hearing_device_about_title);
}
@Override
public void displayPreference(@NonNull PreferenceScreen screen) {
super.displayPreference(screen);
final AccessibilityFooterPreference footerPreference =
screen.findPreference(getPreferenceKey());
// Need to update contentDescription string to announce "than" rather than ">"
final String summaryTts = mContext.getString(
R.string.accessibility_hearing_device_footer_summary_tts);
final String contentDescription = getIntroductionTitle() + "\n\n" + summaryTts;
footerPreference.setContentDescription(contentDescription);
}
}