From 8d9fe53e987fd1538731a29f0a0fdcaa984fa30b Mon Sep 17 00:00:00 2001 From: Kevin Chyn Date: Thu, 11 Apr 2019 15:28:57 -0700 Subject: [PATCH] Make sure biometric icon ends in authenticated state Bug: 129501166 Test: Manual Change-Id: I8cef5f6b60e463906b54dd152f880219b68ae038 --- .../android/systemui/biometrics/BiometricDialogView.java | 2 +- .../com/android/systemui/biometrics/FaceDialogView.java | 8 ++++++++ .../systemui/biometrics/FingerprintDialogView.java | 6 ++++++ 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/packages/SystemUI/src/com/android/systemui/biometrics/BiometricDialogView.java b/packages/SystemUI/src/com/android/systemui/biometrics/BiometricDialogView.java index c92767763cb44..39e0dff5675b3 100644 --- a/packages/SystemUI/src/com/android/systemui/biometrics/BiometricDialogView.java +++ b/packages/SystemUI/src/com/android/systemui/biometrics/BiometricDialogView.java @@ -308,7 +308,7 @@ public abstract class BiometricDialogView extends LinearLayout { protected void updateIcon(int lastState, int newState) { final Drawable icon = getAnimationForTransition(lastState, newState); if (icon == null) { - Log.e(TAG, "Animation not found"); + Log.e(TAG, "Animation not found, " + lastState + " -> " + newState); return; } diff --git a/packages/SystemUI/src/com/android/systemui/biometrics/FaceDialogView.java b/packages/SystemUI/src/com/android/systemui/biometrics/FaceDialogView.java index 9fba44b768630..d26968635dc2a 100644 --- a/packages/SystemUI/src/com/android/systemui/biometrics/FaceDialogView.java +++ b/packages/SystemUI/src/com/android/systemui/biometrics/FaceDialogView.java @@ -330,6 +330,10 @@ public class FaceDialogView extends BiometricDialogView { return true; } else if (oldState == STATE_AUTHENTICATING && newState == STATE_AUTHENTICATED) { return true; + } else if (oldState == STATE_ERROR && newState == STATE_PENDING_CONFIRMATION) { + return true; + } else if (oldState == STATE_ERROR && newState == STATE_AUTHENTICATED) { + return true; } return false; } @@ -364,6 +368,10 @@ public class FaceDialogView extends BiometricDialogView { iconRes = R.drawable.face_dialog_face_blue_to_checkmark; } else if (oldState == STATE_AUTHENTICATING && newState == STATE_AUTHENTICATED) { iconRes = R.drawable.face_dialog_face_gray_to_checkmark; + } else if (oldState == STATE_ERROR && newState == STATE_PENDING_CONFIRMATION) { + iconRes = R.drawable.face_dialog_face_gray_to_face_blue; + } else if (oldState == STATE_ERROR && newState == STATE_AUTHENTICATED) { + iconRes = R.drawable.face_dialog_face_blue_to_checkmark; } else { return null; } diff --git a/packages/SystemUI/src/com/android/systemui/biometrics/FingerprintDialogView.java b/packages/SystemUI/src/com/android/systemui/biometrics/FingerprintDialogView.java index c9b30ba3ce8db..412da1428eca3 100644 --- a/packages/SystemUI/src/com/android/systemui/biometrics/FingerprintDialogView.java +++ b/packages/SystemUI/src/com/android/systemui/biometrics/FingerprintDialogView.java @@ -66,6 +66,9 @@ public class FingerprintDialogView extends BiometricDialogView { } else if (oldState == STATE_AUTHENTICATING && newState == STATE_AUTHENTICATED) { // TODO(b/77328470): add animation when fingerprint is authenticated return false; + } else if (oldState == STATE_ERROR && newState == STATE_AUTHENTICATED) { + // TODO(b/77328470): add animation when fingerprint is authenticated + return false; } return false; } @@ -93,6 +96,9 @@ public class FingerprintDialogView extends BiometricDialogView { } else if (oldState == STATE_AUTHENTICATING && newState == STATE_AUTHENTICATED) { // TODO(b/77328470): add animation when fingerprint is authenticated iconRes = R.drawable.fingerprint_dialog_fp_to_error; + } else if (oldState == STATE_ERROR && newState == STATE_AUTHENTICATED) { + // TODO(b/77328470): add animation when fingerprint is authenticated + iconRes = R.drawable.fingerprint_dialog_fp_to_error; } else { return null; }