Merge "Update lockout state during auth session" into udc-dev
This commit is contained in:
@@ -95,8 +95,10 @@ public class AuthSessionCoordinator implements AuthSessionListener {
|
||||
}
|
||||
}
|
||||
|
||||
mRingBuffer.addApiCall("internal : onAuthSessionEnded(" + mUserId + ")");
|
||||
clearSession();
|
||||
if (mAuthOperations.isEmpty()) {
|
||||
mRingBuffer.addApiCall("internal : onAuthSessionEnded(" + mUserId + ")");
|
||||
clearSession();
|
||||
}
|
||||
}
|
||||
|
||||
private void clearSession() {
|
||||
@@ -203,7 +205,7 @@ public class AuthSessionCoordinator implements AuthSessionListener {
|
||||
return;
|
||||
}
|
||||
mAuthOperations.remove(sensorId);
|
||||
if (mIsAuthenticating && mAuthOperations.isEmpty()) {
|
||||
if (mIsAuthenticating) {
|
||||
endAuthSession();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -135,7 +135,7 @@ public class AuthSessionCoordinatorTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testUserCanAuthDuringLockoutOfSameSession() {
|
||||
public void testUserLockedDuringLockoutOfSameSession() {
|
||||
mCoordinator.resetLockoutFor(PRIMARY_USER, BIOMETRIC_STRONG, 0 /* requestId */);
|
||||
|
||||
assertThat(mCoordinator.getLockoutStateFor(PRIMARY_USER, BIOMETRIC_CONVENIENCE)).isEqualTo(
|
||||
@@ -151,9 +151,9 @@ public class AuthSessionCoordinatorTest {
|
||||
0 /* requestId */);
|
||||
|
||||
assertThat(mCoordinator.getLockoutStateFor(PRIMARY_USER, BIOMETRIC_CONVENIENCE)).isEqualTo(
|
||||
LockoutTracker.LOCKOUT_NONE);
|
||||
LockoutTracker.LOCKOUT_PERMANENT);
|
||||
assertThat(mCoordinator.getLockoutStateFor(PRIMARY_USER, BIOMETRIC_WEAK)).isEqualTo(
|
||||
LockoutTracker.LOCKOUT_NONE);
|
||||
LockoutTracker.LOCKOUT_PERMANENT);
|
||||
assertThat(mCoordinator.getLockoutStateFor(PRIMARY_USER, BIOMETRIC_STRONG)).isEqualTo(
|
||||
LockoutTracker.LOCKOUT_NONE);
|
||||
}
|
||||
@@ -191,9 +191,9 @@ public class AuthSessionCoordinatorTest {
|
||||
0 /* requestId */);
|
||||
|
||||
assertThat(mCoordinator.getLockoutStateFor(PRIMARY_USER, BIOMETRIC_CONVENIENCE)).isEqualTo(
|
||||
LockoutTracker.LOCKOUT_NONE);
|
||||
LockoutTracker.LOCKOUT_PERMANENT);
|
||||
assertThat(mCoordinator.getLockoutStateFor(PRIMARY_USER, BIOMETRIC_WEAK)).isEqualTo(
|
||||
LockoutTracker.LOCKOUT_NONE);
|
||||
LockoutTracker.LOCKOUT_PERMANENT);
|
||||
assertThat(mCoordinator.getLockoutStateFor(PRIMARY_USER, BIOMETRIC_STRONG)).isEqualTo(
|
||||
LockoutTracker.LOCKOUT_NONE);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user