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

Commit 82a893fc authored by Hao Dong's avatar Hao Dong Committed by Android (Google) Code Review
Browse files

Merge "Update lockout state during auth session" into udc-dev

parents beb8b5cf 28c1d6be
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);