From fc3f25c8b52078ba29856dcaa68f782c62855c32 Mon Sep 17 00:00:00 2001 From: Amy Hsu Date: Thu, 8 Sep 2022 00:50:38 +0000 Subject: [PATCH 1/2] [RRS] Send event to AccessibilityManager when an unselect radio button is selected. Change the screen resolution will cause re-layout the screen, so the focus will back to the first view. Before we actually set the screen resolution, send an event to the AccessibilityManager and set what it should say when the user selects the unselect option. Therefore TB will say "selected" before the screen refreshes. bug: 229352892 Test: Enable/disable Talkback and check RRS app behaivor. It should read "selected" after user choose one un-selected option. Change-Id: If14ed3685f85962d4e4b1d4961216c6ca5d5f0f8 --- res/values/strings.xml | 2 ++ .../settings/display/ScreenResolutionFragment.java | 12 ++++++++++++ 2 files changed, 14 insertions(+) diff --git a/res/values/strings.xml b/res/values/strings.xml index 9cdbad75d15..a9f6c1e2e91 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -2983,6 +2983,8 @@ 1440p QHD+ Full resolution uses more of your battery. Switching your resolution may cause some apps to restart. + + Selected Colors diff --git a/src/com/android/settings/display/ScreenResolutionFragment.java b/src/com/android/settings/display/ScreenResolutionFragment.java index 914d4be568a..7c4b3aeef03 100644 --- a/src/com/android/settings/display/ScreenResolutionFragment.java +++ b/src/com/android/settings/display/ScreenResolutionFragment.java @@ -29,6 +29,8 @@ import android.hardware.display.DisplayManager; import android.provider.Settings; import android.text.TextUtils; import android.view.Display; +import android.view.accessibility.AccessibilityEvent; +import android.view.accessibility.AccessibilityManager; import androidx.annotation.VisibleForTesting; import androidx.preference.PreferenceScreen; @@ -65,6 +67,7 @@ public class ScreenResolutionFragment extends RadioButtonPickerFragment { private IllustrationPreference mImagePreference; private DisplayObserver mDisplayObserver; + private AccessibilityManager mAccessibilityManager; @Override public void onAttach(Context context) { @@ -72,6 +75,7 @@ public class ScreenResolutionFragment extends RadioButtonPickerFragment { mDefaultDisplay = context.getSystemService(DisplayManager.class).getDisplay(Display.DEFAULT_DISPLAY); + mAccessibilityManager = context.getSystemService(AccessibilityManager.class); mResources = context.getResources(); mScreenResolutionOptions = mResources.getStringArray(R.array.config_screen_resolution_options_strings); @@ -215,6 +219,14 @@ public class ScreenResolutionFragment extends RadioButtonPickerFragment { if (!mDisplayObserver.setPendingResolutionChange(selectedWidth)) { return; } + + if (mAccessibilityManager.isEnabled()) { + AccessibilityEvent event = AccessibilityEvent.obtain(); + event.setEventType(AccessibilityEvent.TYPE_ANNOUNCEMENT); + event.getText().add(mResources.getString(R.string.screen_resolution_selected_a11y)); + mAccessibilityManager.sendAccessibilityEvent(event); + } + super.onRadioButtonClicked(selected); } From 25f67b32d68ea86c88650fd67dbe0c269cf004ad Mon Sep 17 00:00:00 2001 From: Sayak Dutta Date: Sun, 18 Sep 2022 07:00:52 +0000 Subject: [PATCH 2/2] Fix triggering of link outside the target in the same line Bug: 247297966 Change-Id: I8cab434c3f48ac666664b21303e7be2b36b047c0 --- res/values/strings.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/res/values/strings.xml b/res/values/strings.xml index 22ba27a130c..dd2685717a2 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -3946,13 +3946,13 @@ Format SD card for internal storage - Store apps \u0026 media to use on this tablet only. <a href="https://support.google.com/android/answer/12153449">Learn more about setting up an SD card</a> + Store apps \u0026 media to use on this tablet only. <a href="https://support.google.com/android/answer/12153449">Learn more about setting up an SD card</a>. Format Format SD card for internal storage - Store apps \u0026 media to use on this phone only. <a href="https://support.google.com/android/answer/12153449">Learn more about setting up an SD card</a> + Store apps \u0026 media to use on this phone only. <a href="https://support.google.com/android/answer/12153449">Learn more about setting up an SD card</a>. Format @@ -3960,7 +3960,7 @@ Format SD card for portable storage - Store photos, videos, music, and more and access them from other devices. <a href="https://support.google.com/android/answer/12153449">Learn more about setting up an SD card</a> + Store photos, videos, music, and more and access them from other devices. <a href="https://support.google.com/android/answer/12153449">Learn more about setting up an SD card</a>. Format