From b0b08a8f01ef9c7ae3d9d3d916eae28698f636e9 Mon Sep 17 00:00:00 2001 From: Grace Cheng Date: Mon, 31 Jul 2023 23:56:00 +0000 Subject: [PATCH] Mark title & subtitle focusable, set selected unless a11y active MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Marking title and subtitle important for accessibility to meet a11y requirements. Title and subtitle are also set as selected to enable marquee, unless talkback is on, to avoid announcing "selected" (b/210363098 for context) Test: Manually verified title & subtitle are focusable, not preceded by “Selected” in talkback Fixes: 289000676 Change-Id: Ie070229e3798e9a3f91130cf83507b9efbfce6c0 --- packages/SystemUI/res/layout/biometric_prompt_layout.xml | 2 -- .../systemui/biometrics/ui/binder/BiometricViewBinder.kt | 8 +++++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/SystemUI/res/layout/biometric_prompt_layout.xml b/packages/SystemUI/res/layout/biometric_prompt_layout.xml index ecb0bfa35e9f1..bea0e13c77dc9 100644 --- a/packages/SystemUI/res/layout/biometric_prompt_layout.xml +++ b/packages/SystemUI/res/layout/biometric_prompt_layout.xml @@ -28,7 +28,6 @@ android:singleLine="true" android:marqueeRepeatLimit="1" android:ellipsize="marquee" - android:importantForAccessibility="no" style="@style/TextAppearance.AuthCredential.Title"/> (R.id.subtitle) val descriptionView = view.findViewById(R.id.description) - // set selected for marquee - titleView.isSelected = true - subtitleView.isSelected = true + // set selected to enable marquee unless a screen reader is enabled + titleView.isSelected = + !accessibilityManager.isEnabled || !accessibilityManager.isTouchExplorationEnabled + subtitleView.isSelected = + !accessibilityManager.isEnabled || !accessibilityManager.isTouchExplorationEnabled descriptionView.movementMethod = ScrollingMovementMethod() val iconViewOverlay = view.findViewById(R.id.biometric_icon_overlay)