From 629bc6fb743f12c6a5ef2a0c5427e456ead3afbd Mon Sep 17 00:00:00 2001 From: Candice Lo Date: Mon, 10 Apr 2023 10:41:54 +0000 Subject: [PATCH] Announce the existence of magnification settings We could not put focus on the magnification settings automatically since it is an inactive window. Therefore, we announce the content description of magnification settings when the panel is opened to allow users to be aware of the existence of it. Bug: 274734936 Bug: 241996711 Test: manually - attach videos to the bug Change-Id: I99c2865befa92f0026e57776f288a878cd3a8253 --- .../accessibility/WindowMagnificationSettings.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/packages/SystemUI/src/com/android/systemui/accessibility/WindowMagnificationSettings.java b/packages/SystemUI/src/com/android/systemui/accessibility/WindowMagnificationSettings.java index 6e8275f64eeae..7bfd84e4b6471 100644 --- a/packages/SystemUI/src/com/android/systemui/accessibility/WindowMagnificationSettings.java +++ b/packages/SystemUI/src/com/android/systemui/accessibility/WindowMagnificationSettings.java @@ -346,6 +346,15 @@ class WindowMagnificationSettings implements MagnificationGestureDetector.OnGest setSystemGestureExclusion(); mIsVisible = true; mCallback.onSettingsPanelVisibilityChanged(/* shown= */ true); + + if (resetPosition) { + // We could not put focus on the settings panel automatically + // since it is an inactive window. Therefore, we announce the existence of + // magnification settings for accessibility when it is opened. + mSettingView.announceForAccessibility( + mContext.getResources().getString( + R.string.accessibility_magnification_settings_panel_description)); + } } mContext.registerReceiver(mScreenOffReceiver, new IntentFilter(Intent.ACTION_SCREEN_OFF)); }