summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Grace Cheng <graciecheng@google.com> 2025-04-01 18:43:08 -0700
committer Android Build Coastguard Worker <android-build-coastguard-worker@google.com> 2025-04-04 21:37:55 -0700
commitcfa6ede1c3116cd3ac77470ec67569ecfc938340 (patch)
tree8e5f5865f58a7185d8663158759ed57845702947
parent87b1245ebaa38263e312a3937ac9916d2bbf2364 (diff)
Revert "Replace UDFPS BiometricPrompt a11y announcements with live region"
This reverts commit f022b03cf4d6b3272ce683f51ae40c742c7c5283. Reason for revert: reverting to original accessibility state with announcements (cherry picked from https://googleplex-android-review.googlesource.com/q/commit:43a88d99f359d6a1760272e91d528f7a48a2dd3b) Merged-In: Ie835fa8a190603b5f3183ce030514b09ac25de3c Change-Id: Ie835fa8a190603b5f3183ce030514b09ac25de3c
-rw-r--r--packages/SystemUI/res/layout/biometric_prompt_one_pane_layout.xml3
-rw-r--r--packages/SystemUI/res/layout/biometric_prompt_two_pane_layout.xml3
-rw-r--r--packages/SystemUI/src/com/android/systemui/biometrics/ui/binder/BiometricViewBinder.kt6
-rw-r--r--packages/SystemUI/src/com/android/systemui/biometrics/ui/viewmodel/PromptViewModel.kt2
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/biometrics/ui/viewmodel/PromptViewModelTest.kt4
5 files changed, 5 insertions, 13 deletions
diff --git a/packages/SystemUI/res/layout/biometric_prompt_one_pane_layout.xml b/packages/SystemUI/res/layout/biometric_prompt_one_pane_layout.xml
index 4002f7808637..43808f215a81 100644
--- a/packages/SystemUI/res/layout/biometric_prompt_one_pane_layout.xml
+++ b/packages/SystemUI/res/layout/biometric_prompt_one_pane_layout.xml
@@ -21,9 +21,6 @@
style="@style/AuthCredentialPanelStyle"
android:layout_width="0dp"
android:layout_height="0dp"
- android:accessibilityLiveRegion="assertive"
- android:importantForAccessibility="yes"
- android:clickable="false"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@id/rightGuideline"
app:layout_constraintStart_toStartOf="@id/leftGuideline"
diff --git a/packages/SystemUI/res/layout/biometric_prompt_two_pane_layout.xml b/packages/SystemUI/res/layout/biometric_prompt_two_pane_layout.xml
index 3c8cb6860a41..51117a7845df 100644
--- a/packages/SystemUI/res/layout/biometric_prompt_two_pane_layout.xml
+++ b/packages/SystemUI/res/layout/biometric_prompt_two_pane_layout.xml
@@ -22,9 +22,6 @@ android:layout_height="match_parent">
style="@style/AuthCredentialPanelStyle"
android:layout_width="0dp"
android:layout_height="0dp"
- android:accessibilityLiveRegion="assertive"
- android:importantForAccessibility="yes"
- android:clickable="false"
android:paddingHorizontal="16dp"
android:paddingVertical="16dp"
android:visibility="visible"
diff --git a/packages/SystemUI/src/com/android/systemui/biometrics/ui/binder/BiometricViewBinder.kt b/packages/SystemUI/src/com/android/systemui/biometrics/ui/binder/BiometricViewBinder.kt
index 3b22e13f29a2..54c52b533da4 100644
--- a/packages/SystemUI/src/com/android/systemui/biometrics/ui/binder/BiometricViewBinder.kt
+++ b/packages/SystemUI/src/com/android/systemui/biometrics/ui/binder/BiometricViewBinder.kt
@@ -397,7 +397,7 @@ object BiometricViewBinder {
// Talkback directional guidance
udfpsGuidanceView.setOnHoverListener { _, event ->
launch {
- viewModel.onUpdateAccessibilityHint(
+ viewModel.onAnnounceAccessibilityHint(
event,
accessibilityManager.isTouchExplorationEnabled,
)
@@ -406,9 +406,7 @@ object BiometricViewBinder {
}
launch {
viewModel.accessibilityHint.collect { message ->
- if (message.isNotBlank()) {
- udfpsGuidanceView.contentDescription = message
- }
+ if (message.isNotBlank()) view.announceForAccessibility(message)
}
}
diff --git a/packages/SystemUI/src/com/android/systemui/biometrics/ui/viewmodel/PromptViewModel.kt b/packages/SystemUI/src/com/android/systemui/biometrics/ui/viewmodel/PromptViewModel.kt
index 4e17a2658ee7..0902d19b6787 100644
--- a/packages/SystemUI/src/com/android/systemui/biometrics/ui/viewmodel/PromptViewModel.kt
+++ b/packages/SystemUI/src/com/android/systemui/biometrics/ui/viewmodel/PromptViewModel.kt
@@ -886,7 +886,7 @@ constructor(
}
/** Sets the message used for UDFPS directional guidance */
- suspend fun onUpdateAccessibilityHint(
+ suspend fun onAnnounceAccessibilityHint(
event: MotionEvent,
touchExplorationEnabled: Boolean,
): Boolean {
diff --git a/packages/SystemUI/tests/src/com/android/systemui/biometrics/ui/viewmodel/PromptViewModelTest.kt b/packages/SystemUI/tests/src/com/android/systemui/biometrics/ui/viewmodel/PromptViewModelTest.kt
index bf79d11b2fb8..2c70249bcb06 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/biometrics/ui/viewmodel/PromptViewModelTest.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/biometrics/ui/viewmodel/PromptViewModelTest.kt
@@ -1472,7 +1472,7 @@ internal class PromptViewModelTest(private val testCase: TestCase) : SysuiTestCa
whenever(kosmos.udfpsUtils.onTouchOutsideOfSensorArea(any(), any(), any(), any(), any()))
.thenReturn("Direction")
- kosmos.promptViewModel.onUpdateAccessibilityHint(
+ kosmos.promptViewModel.onAnnounceAccessibilityHint(
obtainMotionEvent(MotionEvent.ACTION_HOVER_ENTER),
true,
)
@@ -1497,7 +1497,7 @@ internal class PromptViewModelTest(private val testCase: TestCase) : SysuiTestCa
whenever(kosmos.udfpsUtils.onTouchOutsideOfSensorArea(any(), any(), any(), any(), any()))
.thenReturn("Direction")
- kosmos.promptViewModel.onUpdateAccessibilityHint(
+ kosmos.promptViewModel.onAnnounceAccessibilityHint(
obtainMotionEvent(MotionEvent.ACTION_HOVER_ENTER),
true,
)