Merge "Fixed talkback issue with biometric prompt." into qt-r1-dev

This commit is contained in:
TreeHugger Robot
2019-07-11 06:14:21 +00:00
committed by Android (Google) Code Review

View File

@@ -282,6 +282,7 @@ public abstract class BiometricDialogView extends LinearLayout {
if (mRestoredState == null) { if (mRestoredState == null) {
updateState(STATE_AUTHENTICATING); updateState(STATE_AUTHENTICATING);
mNegativeButton.setText(mBundle.getCharSequence(BiometricPrompt.KEY_NEGATIVE_TEXT));
final int hint = getHintStringResourceId(); final int hint = getHintStringResourceId();
if (hint != 0) { if (hint != 0) {
mErrorText.setText(hint); mErrorText.setText(hint);
@@ -319,8 +320,6 @@ public abstract class BiometricDialogView extends LinearLayout {
mDescriptionText.setText(descriptionText); mDescriptionText.setText(descriptionText);
} }
mNegativeButton.setText(mBundle.getCharSequence(BiometricPrompt.KEY_NEGATIVE_TEXT));
if (requiresConfirmation() && mRestoredState == null) { if (requiresConfirmation() && mRestoredState == null) {
mPositiveButton.setVisibility(View.VISIBLE); mPositiveButton.setVisibility(View.VISIBLE);
mPositiveButton.setEnabled(false); mPositiveButton.setEnabled(false);
@@ -474,6 +473,8 @@ public abstract class BiometricDialogView extends LinearLayout {
mHandler.removeMessages(MSG_RESET_MESSAGE); mHandler.removeMessages(MSG_RESET_MESSAGE);
mErrorText.setTextColor(mTextColor); mErrorText.setTextColor(mTextColor);
mErrorText.setText(R.string.biometric_dialog_tap_confirm); mErrorText.setText(R.string.biometric_dialog_tap_confirm);
mErrorText.setContentDescription(
getResources().getString(R.string.biometric_dialog_tap_confirm));
mErrorText.setVisibility(View.VISIBLE); mErrorText.setVisibility(View.VISIBLE);
announceAccessibilityEvent(); announceAccessibilityEvent();
mPositiveButton.setVisibility(View.VISIBLE); mPositiveButton.setVisibility(View.VISIBLE);
@@ -487,6 +488,7 @@ public abstract class BiometricDialogView extends LinearLayout {
if (newState == STATE_PENDING_CONFIRMATION || newState == STATE_AUTHENTICATED) { if (newState == STATE_PENDING_CONFIRMATION || newState == STATE_AUTHENTICATED) {
mNegativeButton.setText(R.string.cancel); mNegativeButton.setText(R.string.cancel);
mNegativeButton.setContentDescription(getResources().getString(R.string.cancel));
} }
updateIcon(mState, newState); updateIcon(mState, newState);