diff options
| author | 2022-04-25 13:50:53 -0700 | |
|---|---|---|
| committer | 2022-04-25 13:53:12 -0700 | |
| commit | fb1b56a7b59d523f0ba9974157dbd7c724ad192c (patch) | |
| tree | 388cf1911b96cddee1fa52e5ab44b533f4777710 | |
| parent | 87f7c3e8cab753866185b8edc20ea90efa287d7c (diff) | |
Always play haptic on UDFPS reject.
Bug: 195161518
Test: atest CoexCoordinatorTest
Change-Id: I259d30b20fe613b4f15067d20379dc6c63d774b6
| -rw-r--r-- | services/core/java/com/android/server/biometrics/sensors/CoexCoordinator.java | 21 | ||||
| -rw-r--r-- | services/tests/servicestests/src/com/android/server/biometrics/sensors/CoexCoordinatorTest.java | 4 |
2 files changed, 5 insertions, 20 deletions
diff --git a/services/core/java/com/android/server/biometrics/sensors/CoexCoordinator.java b/services/core/java/com/android/server/biometrics/sensors/CoexCoordinator.java index 5aa9b79c074c..c8a90e7a564b 100644 --- a/services/core/java/com/android/server/biometrics/sensors/CoexCoordinator.java +++ b/services/core/java/com/android/server/biometrics/sensors/CoexCoordinator.java @@ -92,7 +92,7 @@ public class CoexCoordinator { void sendHapticFeedback(); } - private static CoexCoordinator sInstance; + private static final CoexCoordinator sInstance = new CoexCoordinator(); @VisibleForTesting public static class SuccessfulAuth { @@ -147,14 +147,9 @@ public class CoexCoordinator { } } - /** - * @return a singleton instance. - */ + /** The singleton instance. */ @NonNull public static CoexCoordinator getInstance() { - if (sInstance == null) { - sInstance = new CoexCoordinator(); - } return sInstance; } @@ -339,18 +334,8 @@ public class CoexCoordinator { auth.mCallback.sendHapticFeedback(); auth.mCallback.sendAuthenticationResult(true /* addAuthTokenIfStrong */); auth.mCallback.handleLifecycleAfterAuth(); - } else if (isFaceScanning()) { - // UDFPS rejected but face is still scanning - Slog.d(TAG, "UDFPS rejected in multi-sensor auth, face: " + face); - callback.handleLifecycleAfterAuth(); - - // TODO(b/193089985): Enforce/ensure that face auth finishes (whether - // accept/reject) within X amount of time. Otherwise users will be stuck - // waiting with their finger down for a long time. } else { - // Face not scanning, and was not found in the queue. Most likely, face - // auth was too long ago. - Slog.d(TAG, "UDFPS rejected in multi-sensor auth, face not scanning"); + Slog.d(TAG, "UDFPS rejected in multi-sensor auth"); callback.sendHapticFeedback(); callback.handleLifecycleAfterAuth(); } diff --git a/services/tests/servicestests/src/com/android/server/biometrics/sensors/CoexCoordinatorTest.java b/services/tests/servicestests/src/com/android/server/biometrics/sensors/CoexCoordinatorTest.java index f40b31a0bc0d..abf992b6c637 100644 --- a/services/tests/servicestests/src/com/android/server/biometrics/sensors/CoexCoordinatorTest.java +++ b/services/tests/servicestests/src/com/android/server/biometrics/sensors/CoexCoordinatorTest.java @@ -415,7 +415,7 @@ public class CoexCoordinatorTest { // Auth was attempted when(mUdfpsClient.getState()) .thenReturn(AuthenticationClient.STATE_STARTED_PAUSED_ATTEMPTED); - verify(mCallback, never()).sendHapticFeedback(); + verify(mCallback).sendHapticFeedback(); verify(mCallback).handleLifecycleAfterAuth(); // Then face rejected. Note that scheduler leaves UDFPS in the CoexCoordinator since @@ -425,7 +425,7 @@ public class CoexCoordinatorTest { LockoutTracker.LOCKOUT_NONE, faceCallback); verify(faceCallback).sendHapticFeedback(); verify(faceCallback).sendAuthenticationResult(eq(false) /* addAuthTokenIfStrong */); - verify(mCallback, never()).sendHapticFeedback(); + verify(mCallback).sendHapticFeedback(); } @Test |