diff options
| author | 2021-10-20 18:03:54 +0000 | |
|---|---|---|
| committer | 2021-10-20 18:03:54 +0000 | |
| commit | c2993b24458e7fa6bcb79d01a81ab5dad876a375 (patch) | |
| tree | 05d173d4d8425bd1d250ccbb278f957f2f04b632 | |
| parent | 31281969e61702062e8852786252e076a3812cd2 (diff) | |
| parent | ae9471fe51458f5044f04de4414c8841895c7cc9 (diff) | |
Merge "Added lockout callback to FaceAuthenticationClient" into sc-v2-dev
2 files changed, 39 insertions, 0 deletions
diff --git a/services/core/java/com/android/server/biometrics/sensors/AuthenticationClient.java b/services/core/java/com/android/server/biometrics/sensors/AuthenticationClient.java index 85d6d7fb2f6a..031f6eeeca5f 100644 --- a/services/core/java/com/android/server/biometrics/sensors/AuthenticationClient.java +++ b/services/core/java/com/android/server/biometrics/sensors/AuthenticationClient.java @@ -360,6 +360,43 @@ public abstract class AuthenticationClient<T> extends AcquisitionClient<T> } } + /** + * Only call this method on interfaces where lockout does not come from onError, I.E. the + * old HIDL implementation. + */ + protected void onLockoutTimed(long durationMillis) { + final ClientMonitorCallbackConverter listener = getListener(); + final CoexCoordinator coordinator = CoexCoordinator.getInstance(); + coordinator.onAuthenticationError(this, BiometricConstants.BIOMETRIC_ERROR_LOCKOUT, + new CoexCoordinator.ErrorCallback() { + @Override + public void sendHapticFeedback() { + if (listener != null && mShouldVibrate) { + vibrateError(); + } + } + }); + } + + /** + * Only call this method on interfaces where lockout does not come from onError, I.E. the + * old HIDL implementation. + */ + protected void onLockoutPermanent() { + final ClientMonitorCallbackConverter listener = getListener(); + final CoexCoordinator coordinator = CoexCoordinator.getInstance(); + coordinator.onAuthenticationError(this, + BiometricConstants.BIOMETRIC_ERROR_LOCKOUT_PERMANENT, + new CoexCoordinator.ErrorCallback() { + @Override + public void sendHapticFeedback() { + if (listener != null && mShouldVibrate) { + vibrateError(); + } + } + }); + } + private void sendCancelOnly(@Nullable ClientMonitorCallbackConverter listener) { if (listener == null) { Slog.e(TAG, "Unable to sendAuthenticationCanceled, listener null"); diff --git a/services/core/java/com/android/server/biometrics/sensors/face/aidl/FaceAuthenticationClient.java b/services/core/java/com/android/server/biometrics/sensors/face/aidl/FaceAuthenticationClient.java index cbceba6cc959..97d791b7e1c9 100644 --- a/services/core/java/com/android/server/biometrics/sensors/face/aidl/FaceAuthenticationClient.java +++ b/services/core/java/com/android/server/biometrics/sensors/face/aidl/FaceAuthenticationClient.java @@ -225,6 +225,7 @@ class FaceAuthenticationClient extends AuthenticationClient<ISession> implements @Override public void onLockoutTimed(long durationMillis) { + super.onLockoutTimed(durationMillis); mLockoutCache.setLockoutModeForUser(getTargetUserId(), LockoutTracker.LOCKOUT_TIMED); // Lockout metrics are logged as an error code. final int error = BiometricFaceConstants.FACE_ERROR_LOCKOUT; @@ -239,6 +240,7 @@ class FaceAuthenticationClient extends AuthenticationClient<ISession> implements @Override public void onLockoutPermanent() { + super.onLockoutPermanent(); mLockoutCache.setLockoutModeForUser(getTargetUserId(), LockoutTracker.LOCKOUT_PERMANENT); // Lockout metrics are logged as an error code. final int error = BiometricFaceConstants.FACE_ERROR_LOCKOUT_PERMANENT; |