Merge "fix(high contrast text): Uses a new string resource for the settings action." into main

This commit is contained in:
Treehugger Robot
2025-02-04 16:24:08 -08:00
committed by Android (Google) Code Review
2 changed files with 5 additions and 4 deletions

View File

@@ -5511,8 +5511,8 @@
<string name="accessibility_notification_high_contrast_text_title">Improve text contrast</string>
<!-- Text content for the notification that high contrast text has been replaced. [CHAR LIMIT=NONE] -->
<string name="accessibility_notification_high_contrast_text_body"><xliff:g example="Outline text" id="outline_text">%1$s</xliff:g> has replaced <xliff:g example="high contrast text" id="high_contrast_text">%2$s</xliff:g>. You can turn it on in <xliff:g example="Settings" id="settings">%3$s</xliff:g>.</string>
<!-- Action for the notification to high contrast text. [CHAR LIMIT=35] -->
<string name="accessibility_notification_high_contrast_text_action">Go to <xliff:g example="Settings" id="settings">%1$s</xliff:g></string>
<!-- Action for the notification to high contrast text to open the Settings app. [CHAR LIMIT=35] -->
<string name="accessibility_notification_high_contrast_text_action_open_settings">Go to <xliff:g example="Settings" id="settings">%1$s</xliff:g></string>
<!-- Title for the accessibility preference that adds an outline behind text to increase contrast and legibility. [CHAR LIMIT=35] -->
<string name="accessibility_toggle_maximize_text_contrast_preference_title">Outline text</string>
<!-- Summary for the accessibility preference to high contrast text. [CHAR LIMIT=NONE] -->

View File

@@ -163,10 +163,11 @@ public class HighContrastTextMigrationReceiver extends BroadcastReceiver {
actionIntent.setAction(ACTION_OPEN_SETTINGS);
PendingIntent actionPendingIntent = PendingIntent.getBroadcast(context, 0,
actionIntent, PendingIntent.FLAG_IMMUTABLE);
final int actionResId =
R.string.accessibility_notification_high_contrast_text_action_open_settings;
Notification.Action settingsAction = new Notification.Action.Builder(
/* icon= */ null,
context.getString(R.string.accessibility_notification_high_contrast_text_action,
context.getString(R.string.settings_label)),
context.getString(actionResId, context.getString(R.string.settings_label)),
actionPendingIntent
).build();