Merge "Don't show hint while authenticating, show hint while pending confirmation" into qt-r1-dev am: 0b15745b37
am: 1eb83ae444
Change-Id: Idab324dec63a363e86b19f1ef282beb77c428c22
This commit is contained in:
@@ -303,6 +303,8 @@
|
||||
<string name="biometric_dialog_face_icon_description_authenticated">Face authenticated</string>
|
||||
<!-- Content description for the face icon when the user has been authenticated and the confirm button has been pressed [CHAR LIMIT=NONE] -->
|
||||
<string name="biometric_dialog_face_icon_description_confirmed">Confirmed</string>
|
||||
<!-- Message shown when a biometric is authenticated, waiting for the user to confirm authentication [CHAR LIMIT=40]-->
|
||||
<string name="biometric_dialog_tap_confirm">Tap Confirm to complete</string>
|
||||
|
||||
<!-- Message shown when the system-provided fingerprint dialog is shown, asking for authentication -->
|
||||
<string name="fingerprint_dialog_touch_sensor">Touch the fingerprint sensor</string>
|
||||
|
||||
@@ -59,6 +59,7 @@ public abstract class BiometricDialogView extends LinearLayout {
|
||||
|
||||
private static final String KEY_TRY_AGAIN_VISIBILITY = "key_try_again_visibility";
|
||||
private static final String KEY_CONFIRM_VISIBILITY = "key_confirm_visibility";
|
||||
private static final String KEY_CONFIRM_ENABLED = "key_confirm_enabled";
|
||||
private static final String KEY_STATE = "key_state";
|
||||
private static final String KEY_ERROR_TEXT_VISIBILITY = "key_error_text_visibility";
|
||||
private static final String KEY_ERROR_TEXT_STRING = "key_error_text_string";
|
||||
@@ -232,6 +233,10 @@ public abstract class BiometricDialogView extends LinearLayout {
|
||||
handleResetMessage();
|
||||
updateState(STATE_AUTHENTICATING);
|
||||
showTryAgainButton(false /* show */);
|
||||
|
||||
mPositiveButton.setVisibility(View.VISIBLE);
|
||||
mPositiveButton.setEnabled(false);
|
||||
|
||||
mCallback.onTryAgainPressed();
|
||||
});
|
||||
|
||||
@@ -243,6 +248,7 @@ public abstract class BiometricDialogView extends LinearLayout {
|
||||
public void onSaveState(Bundle bundle) {
|
||||
bundle.putInt(KEY_TRY_AGAIN_VISIBILITY, mTryAgainButton.getVisibility());
|
||||
bundle.putInt(KEY_CONFIRM_VISIBILITY, mPositiveButton.getVisibility());
|
||||
bundle.putBoolean(KEY_CONFIRM_ENABLED, mPositiveButton.isEnabled());
|
||||
bundle.putInt(KEY_STATE, mState);
|
||||
bundle.putInt(KEY_ERROR_TEXT_VISIBILITY, mErrorText.getVisibility());
|
||||
bundle.putCharSequence(KEY_ERROR_TEXT_STRING, mErrorText.getText());
|
||||
@@ -275,9 +281,15 @@ public abstract class BiometricDialogView extends LinearLayout {
|
||||
|
||||
if (mRestoredState == null) {
|
||||
updateState(STATE_AUTHENTICATING);
|
||||
mErrorText.setText(getHintStringResourceId());
|
||||
mErrorText.setContentDescription(mContext.getString(getHintStringResourceId()));
|
||||
mErrorText.setVisibility(View.VISIBLE);
|
||||
final int hint = getHintStringResourceId();
|
||||
if (hint != 0) {
|
||||
mErrorText.setText(hint);
|
||||
mErrorText.setContentDescription(mContext.getString(hint));
|
||||
mErrorText.setVisibility(View.VISIBLE);
|
||||
} else {
|
||||
mErrorText.setVisibility(View.INVISIBLE);
|
||||
}
|
||||
announceAccessibilityEvent();
|
||||
} else {
|
||||
updateState(mState);
|
||||
}
|
||||
@@ -425,6 +437,7 @@ public abstract class BiometricDialogView extends LinearLayout {
|
||||
mErrorText.setText(message);
|
||||
mErrorText.setTextColor(mErrorColor);
|
||||
mErrorText.setContentDescription(message);
|
||||
mErrorText.setVisibility(View.VISIBLE);
|
||||
mHandler.sendMessageDelayed(mHandler.obtainMessage(MSG_RESET_MESSAGE),
|
||||
BiometricPrompt.HIDE_DIALOG_DELAY);
|
||||
}
|
||||
@@ -458,7 +471,9 @@ public abstract class BiometricDialogView extends LinearLayout {
|
||||
public void updateState(int newState) {
|
||||
if (newState == STATE_PENDING_CONFIRMATION) {
|
||||
mHandler.removeMessages(MSG_RESET_MESSAGE);
|
||||
mErrorText.setVisibility(View.INVISIBLE);
|
||||
mErrorText.setTextColor(mTextColor);
|
||||
mErrorText.setText(R.string.biometric_dialog_tap_confirm);
|
||||
mErrorText.setVisibility(View.VISIBLE);
|
||||
announceAccessibilityEvent();
|
||||
mPositiveButton.setVisibility(View.VISIBLE);
|
||||
mPositiveButton.setEnabled(true);
|
||||
@@ -489,6 +504,8 @@ public abstract class BiometricDialogView extends LinearLayout {
|
||||
mTryAgainButton.setVisibility(tryAgainVisibility);
|
||||
final int confirmVisibility = bundle.getInt(KEY_CONFIRM_VISIBILITY);
|
||||
mPositiveButton.setVisibility(confirmVisibility);
|
||||
final boolean confirmEnabled = bundle.getBoolean(KEY_CONFIRM_ENABLED);
|
||||
mPositiveButton.setEnabled(confirmEnabled);
|
||||
mState = bundle.getInt(KEY_STATE);
|
||||
mErrorText.setText(bundle.getCharSequence(KEY_ERROR_TEXT_STRING));
|
||||
mErrorText.setContentDescription(bundle.getCharSequence(KEY_ERROR_TEXT_STRING));
|
||||
|
||||
@@ -289,15 +289,9 @@ public class FaceDialogView extends BiometricDialogView {
|
||||
|
||||
@Override
|
||||
protected void handleResetMessage() {
|
||||
mErrorText.setText(getHintStringResourceId());
|
||||
mErrorText.setContentDescription(mContext.getString(getHintStringResourceId()));
|
||||
mErrorText.setTextColor(mTextColor);
|
||||
if (getState() == STATE_AUTHENTICATING) {
|
||||
mErrorText.setVisibility(View.VISIBLE);
|
||||
} else {
|
||||
mErrorText.setVisibility(View.INVISIBLE);
|
||||
announceAccessibilityEvent();
|
||||
}
|
||||
mErrorText.setVisibility(View.INVISIBLE);
|
||||
announceAccessibilityEvent();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -383,7 +377,7 @@ public class FaceDialogView extends BiometricDialogView {
|
||||
|
||||
@Override
|
||||
protected int getHintStringResourceId() {
|
||||
return R.string.face_dialog_looking_for_face;
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -408,7 +402,6 @@ public class FaceDialogView extends BiometricDialogView {
|
||||
mHandler.removeCallbacks(mErrorToIdleAnimationRunnable);
|
||||
if (mDialogAnimatedIn) {
|
||||
mIconController.startPulsing();
|
||||
mErrorText.setVisibility(View.VISIBLE);
|
||||
} else {
|
||||
mIconController.showIcon(R.drawable.face_dialog_pulse_dark_to_light);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user