Handle [error->pending_confirmation] and [error->authenticated] animations

It's possible to go from error state to either of the onAuthenticated
states. Thus, initiate animation when that happens

Fixes: 132124967

Test: Modify code to coerce UI into bad state. Apply patch, bad state
      is not seen anymore

Change-Id: I34fbf0801721d57e509675a9b4ecc38ead143ba6
This commit is contained in:
Kevin Chyn
2019-05-07 16:02:53 -07:00
parent aae9d6c77a
commit a60118cfa9

View File

@@ -402,6 +402,12 @@ public class FaceDialogView extends BiometricDialogView {
} else if (oldState == STATE_ERROR && newState == STATE_AUTHENTICATING) {
mHandler.removeCallbacks(mErrorToIdleAnimationRunnable);
mIconController.startPulsing();
} else if (oldState == STATE_ERROR && newState == STATE_PENDING_CONFIRMATION) {
mHandler.removeCallbacks(mErrorToIdleAnimationRunnable);
mIconController.animateOnce(R.drawable.face_dialog_wink_from_dark);
} else if (oldState == STATE_ERROR && newState == STATE_AUTHENTICATED) {
mHandler.removeCallbacks(mErrorToIdleAnimationRunnable);
mIconController.animateOnce(R.drawable.face_dialog_dark_to_checkmark);
} else if (oldState == STATE_AUTHENTICATING && newState == STATE_ERROR) {
mIconController.animateOnce(R.drawable.face_dialog_dark_to_error);
mHandler.postDelayed(mErrorToIdleAnimationRunnable, BiometricPrompt.HIDE_DIALOG_DELAY);