Merge "Update contentDescription to announce 'than' rather than '>'" into main

This commit is contained in:
Jason Hsu
2024-12-19 08:38:33 -08:00
committed by Android (Google) Code Review
2 changed files with 18 additions and 0 deletions

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);
}
}