Merge "Finish FaceAuthClient onLockout" into udc-qpr-dev am: 9a60d6d679
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/23711412 Change-Id: I76ae140b046f2e0bccae98c7e2f00eb16924163c Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
@@ -212,6 +212,8 @@ class FaceAuthenticationClient extends AuthenticationClient<AidlSession, FaceAut
|
|||||||
// 1) Authenticated == true
|
// 1) Authenticated == true
|
||||||
// 2) Error occurred
|
// 2) Error occurred
|
||||||
// 3) Authenticated == false
|
// 3) Authenticated == false
|
||||||
|
// 4) onLockout
|
||||||
|
// 5) onLockoutTimed
|
||||||
mCallback.onClientFinished(this, true /* success */);
|
mCallback.onClientFinished(this, true /* success */);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -304,11 +306,7 @@ class FaceAuthenticationClient extends AuthenticationClient<AidlSession, FaceAut
|
|||||||
PerformanceTracker.getInstanceForSensorId(getSensorId())
|
PerformanceTracker.getInstanceForSensorId(getSensorId())
|
||||||
.incrementTimedLockoutForUser(getTargetUserId());
|
.incrementTimedLockoutForUser(getTargetUserId());
|
||||||
|
|
||||||
try {
|
onError(error, 0 /* vendorCode */);
|
||||||
getListener().onError(getSensorId(), getCookie(), error, 0 /* vendorCode */);
|
|
||||||
} catch (RemoteException e) {
|
|
||||||
Slog.e(TAG, "Remote exception", e);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -323,10 +321,6 @@ class FaceAuthenticationClient extends AuthenticationClient<AidlSession, FaceAut
|
|||||||
PerformanceTracker.getInstanceForSensorId(getSensorId())
|
PerformanceTracker.getInstanceForSensorId(getSensorId())
|
||||||
.incrementPermanentLockoutForUser(getTargetUserId());
|
.incrementPermanentLockoutForUser(getTargetUserId());
|
||||||
|
|
||||||
try {
|
onError(error, 0 /* vendorCode */);
|
||||||
getListener().onError(getSensorId(), getCookie(), error, 0 /* vendorCode */);
|
|
||||||
} catch (RemoteException e) {
|
|
||||||
Slog.e(TAG, "Remote exception", e);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -487,7 +487,7 @@ public class FaceProvider implements IBinder.DeathRecipient, ServiceProvider {
|
|||||||
BaseClientMonitor clientMonitor,
|
BaseClientMonitor clientMonitor,
|
||||||
boolean success) {
|
boolean success) {
|
||||||
mAuthSessionCoordinator.authEndedFor(userId, Utils.getCurrentStrength(sensorId),
|
mAuthSessionCoordinator.authEndedFor(userId, Utils.getCurrentStrength(sensorId),
|
||||||
sensorId, requestId, success);
|
sensorId, requestId, client.wasAuthSuccessful());
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -151,6 +151,28 @@ public class FaceAuthenticationClientTest {
|
|||||||
verify(mHal, never()).authenticate(anyLong());
|
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
|
@Test
|
||||||
public void notifyHalWhenContextChanges() throws RemoteException {
|
public void notifyHalWhenContextChanges() throws RemoteException {
|
||||||
final FaceAuthenticationClient client = createClient();
|
final FaceAuthenticationClient client = createClient();
|
||||||
|
|||||||
Reference in New Issue
Block a user