From a1c777ee2922765a6f71b4c5bae110038748db18 Mon Sep 17 00:00:00 2001 From: joshmccloskey Date: Wed, 10 Jul 2019 17:15:15 -0700 Subject: [PATCH] Fixed talkback issue with biometric prompt. Test: Manual. Fixes: 137164433 Change-Id: Ie5d241762769b275fc7616e2f5bb8378a064ed98 --- .../android/systemui/biometrics/BiometricDialogView.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/SystemUI/src/com/android/systemui/biometrics/BiometricDialogView.java b/packages/SystemUI/src/com/android/systemui/biometrics/BiometricDialogView.java index 932e40c77af09..a5857df8ba5a9 100644 --- a/packages/SystemUI/src/com/android/systemui/biometrics/BiometricDialogView.java +++ b/packages/SystemUI/src/com/android/systemui/biometrics/BiometricDialogView.java @@ -282,6 +282,7 @@ public abstract class BiometricDialogView extends LinearLayout { if (mRestoredState == null) { updateState(STATE_AUTHENTICATING); + mNegativeButton.setText(mBundle.getCharSequence(BiometricPrompt.KEY_NEGATIVE_TEXT)); final int hint = getHintStringResourceId(); if (hint != 0) { mErrorText.setText(hint); @@ -319,8 +320,6 @@ public abstract class BiometricDialogView extends LinearLayout { mDescriptionText.setText(descriptionText); } - mNegativeButton.setText(mBundle.getCharSequence(BiometricPrompt.KEY_NEGATIVE_TEXT)); - if (requiresConfirmation() && mRestoredState == null) { mPositiveButton.setVisibility(View.VISIBLE); mPositiveButton.setEnabled(false); @@ -474,6 +473,8 @@ public abstract class BiometricDialogView extends LinearLayout { mHandler.removeMessages(MSG_RESET_MESSAGE); mErrorText.setTextColor(mTextColor); mErrorText.setText(R.string.biometric_dialog_tap_confirm); + mErrorText.setContentDescription( + getResources().getString(R.string.biometric_dialog_tap_confirm)); mErrorText.setVisibility(View.VISIBLE); announceAccessibilityEvent(); mPositiveButton.setVisibility(View.VISIBLE); @@ -487,6 +488,7 @@ public abstract class BiometricDialogView extends LinearLayout { if (newState == STATE_PENDING_CONFIRMATION || newState == STATE_AUTHENTICATED) { mNegativeButton.setText(R.string.cancel); + mNegativeButton.setContentDescription(getResources().getString(R.string.cancel)); } updateIcon(mState, newState);