Loading services/core/java/com/android/server/biometrics/sensors/face/aidl/FaceAuthenticationClient.java +4 −10 Original line number Diff line number Diff line Loading @@ -212,6 +212,8 @@ class FaceAuthenticationClient extends AuthenticationClient<AidlSession, FaceAut // 1) Authenticated == true // 2) Error occurred // 3) Authenticated == false // 4) onLockout // 5) onLockoutTimed mCallback.onClientFinished(this, true /* success */); } Loading Loading @@ -304,11 +306,7 @@ class FaceAuthenticationClient extends AuthenticationClient<AidlSession, FaceAut PerformanceTracker.getInstanceForSensorId(getSensorId()) .incrementTimedLockoutForUser(getTargetUserId()); try { getListener().onError(getSensorId(), getCookie(), error, 0 /* vendorCode */); } catch (RemoteException e) { Slog.e(TAG, "Remote exception", e); } onError(error, 0 /* vendorCode */); } @Override Loading @@ -323,10 +321,6 @@ class FaceAuthenticationClient extends AuthenticationClient<AidlSession, FaceAut PerformanceTracker.getInstanceForSensorId(getSensorId()) .incrementPermanentLockoutForUser(getTargetUserId()); try { getListener().onError(getSensorId(), getCookie(), error, 0 /* vendorCode */); } catch (RemoteException e) { Slog.e(TAG, "Remote exception", e); } onError(error, 0 /* vendorCode */); } } services/core/java/com/android/server/biometrics/sensors/face/aidl/FaceProvider.java +1 −1 Original line number Diff line number Diff line Loading @@ -465,7 +465,7 @@ public class FaceProvider implements IBinder.DeathRecipient, ServiceProvider { BaseClientMonitor clientMonitor, boolean success) { mAuthSessionCoordinator.authEndedFor(userId, Utils.getCurrentStrength(sensorId), sensorId, requestId, success); sensorId, requestId, client.wasAuthSuccessful()); } }); }); Loading services/tests/servicestests/src/com/android/server/biometrics/sensors/face/aidl/FaceAuthenticationClientTest.java +24 −0 Original line number Diff line number Diff line Loading @@ -16,6 +16,8 @@ package com.android.server.biometrics.sensors.face.aidl; import static android.hardware.biometrics.BiometricFaceConstants.FACE_ERROR_LOCKOUT; import static android.hardware.biometrics.BiometricFaceConstants.FACE_ERROR_LOCKOUT_PERMANENT; import static com.google.common.truth.Truth.assertThat; import static org.mockito.ArgumentMatchers.any; Loading Loading @@ -147,6 +149,28 @@ public class FaceAuthenticationClientTest { verify(mHal, never()).authenticate(anyLong()); } @Test public void testLockoutEndsOperation() throws RemoteException { final FaceAuthenticationClient client = createClient(2); client.start(mCallback); client.onLockoutPermanent(); verify(mClientMonitorCallbackConverter).onError(anyInt(), anyInt(), eq(FACE_ERROR_LOCKOUT_PERMANENT), anyInt()); verify(mCallback).onClientFinished(client, false); } @Test public void testTemporaryLockoutEndsOperation() throws RemoteException { final FaceAuthenticationClient client = createClient(2); client.start(mCallback); client.onLockoutTimed(1000); verify(mClientMonitorCallbackConverter).onError(anyInt(), anyInt(), eq(FACE_ERROR_LOCKOUT), anyInt()); verify(mCallback).onClientFinished(client, false); } @Test public void notifyHalWhenContextChanges() throws RemoteException { final FaceAuthenticationClient client = createClient(); Loading Loading
services/core/java/com/android/server/biometrics/sensors/face/aidl/FaceAuthenticationClient.java +4 −10 Original line number Diff line number Diff line Loading @@ -212,6 +212,8 @@ class FaceAuthenticationClient extends AuthenticationClient<AidlSession, FaceAut // 1) Authenticated == true // 2) Error occurred // 3) Authenticated == false // 4) onLockout // 5) onLockoutTimed mCallback.onClientFinished(this, true /* success */); } Loading Loading @@ -304,11 +306,7 @@ class FaceAuthenticationClient extends AuthenticationClient<AidlSession, FaceAut PerformanceTracker.getInstanceForSensorId(getSensorId()) .incrementTimedLockoutForUser(getTargetUserId()); try { getListener().onError(getSensorId(), getCookie(), error, 0 /* vendorCode */); } catch (RemoteException e) { Slog.e(TAG, "Remote exception", e); } onError(error, 0 /* vendorCode */); } @Override Loading @@ -323,10 +321,6 @@ class FaceAuthenticationClient extends AuthenticationClient<AidlSession, FaceAut PerformanceTracker.getInstanceForSensorId(getSensorId()) .incrementPermanentLockoutForUser(getTargetUserId()); try { getListener().onError(getSensorId(), getCookie(), error, 0 /* vendorCode */); } catch (RemoteException e) { Slog.e(TAG, "Remote exception", e); } onError(error, 0 /* vendorCode */); } }
services/core/java/com/android/server/biometrics/sensors/face/aidl/FaceProvider.java +1 −1 Original line number Diff line number Diff line Loading @@ -465,7 +465,7 @@ public class FaceProvider implements IBinder.DeathRecipient, ServiceProvider { BaseClientMonitor clientMonitor, boolean success) { mAuthSessionCoordinator.authEndedFor(userId, Utils.getCurrentStrength(sensorId), sensorId, requestId, success); sensorId, requestId, client.wasAuthSuccessful()); } }); }); Loading
services/tests/servicestests/src/com/android/server/biometrics/sensors/face/aidl/FaceAuthenticationClientTest.java +24 −0 Original line number Diff line number Diff line Loading @@ -16,6 +16,8 @@ package com.android.server.biometrics.sensors.face.aidl; import static android.hardware.biometrics.BiometricFaceConstants.FACE_ERROR_LOCKOUT; import static android.hardware.biometrics.BiometricFaceConstants.FACE_ERROR_LOCKOUT_PERMANENT; import static com.google.common.truth.Truth.assertThat; import static org.mockito.ArgumentMatchers.any; Loading Loading @@ -147,6 +149,28 @@ public class FaceAuthenticationClientTest { verify(mHal, never()).authenticate(anyLong()); } @Test public void testLockoutEndsOperation() throws RemoteException { final FaceAuthenticationClient client = createClient(2); client.start(mCallback); client.onLockoutPermanent(); verify(mClientMonitorCallbackConverter).onError(anyInt(), anyInt(), eq(FACE_ERROR_LOCKOUT_PERMANENT), anyInt()); verify(mCallback).onClientFinished(client, false); } @Test public void testTemporaryLockoutEndsOperation() throws RemoteException { final FaceAuthenticationClient client = createClient(2); client.start(mCallback); client.onLockoutTimed(1000); verify(mClientMonitorCallbackConverter).onError(anyInt(), anyInt(), eq(FACE_ERROR_LOCKOUT), anyInt()); verify(mCallback).onClientFinished(client, false); } @Test public void notifyHalWhenContextChanges() throws RemoteException { final FaceAuthenticationClient client = createClient(); Loading