Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 28c1d6be authored by Hao Dong's avatar Hao Dong
Browse files

Update lockout state during auth session

Test: atest AuthSessionCoordinatorTest
Bug: 275743371
Change-Id: Icf4ab00f6ace970d97a0de953c6ec9e7fcc0a798
parent 6a2dd9b9
Loading
Loading
Loading
Loading
+5 −3
Original line number Diff line number Diff line
@@ -95,9 +95,11 @@ public class AuthSessionCoordinator implements AuthSessionListener {
            }
        }

        if (mAuthOperations.isEmpty()) {
            mRingBuffer.addApiCall("internal : onAuthSessionEnded(" + mUserId + ")");
            clearSession();
        }
    }

    private void clearSession() {
        mIsAuthenticating = false;
@@ -203,7 +205,7 @@ public class AuthSessionCoordinator implements AuthSessionListener {
            return;
        }
        mAuthOperations.remove(sensorId);
        if (mIsAuthenticating && mAuthOperations.isEmpty()) {
        if (mIsAuthenticating) {
            endAuthSession();
        }
    }
+5 −5
Original line number Diff line number Diff line
@@ -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);