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

Commit f486c0b4 authored by Joshua Mccloskey's avatar Joshua Mccloskey Committed by Automerger Merge Worker
Browse files

Merge "Fixed double face auth on swipe" into sc-dev am: 4438cf67 am: 2caa5cfd

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15301708

Change-Id: I81a6451da008503a50d08a910e0e0cd2c02f9161
parents 960f29b4 2caa5cfd
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -23,5 +23,6 @@ data class KeyguardFaceListenModel(
    val isLockIconPressed: Boolean,
    val isScanningAllowedByStrongAuth: Boolean,
    val isPrimaryUser: Boolean,
    val isSecureCameraLaunched: Boolean
    val isSecureCameraLaunched: Boolean,
    val isFaceAuthenticated: Boolean
)
+17 −3
Original line number Diff line number Diff line
@@ -1058,9 +1058,18 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener, Dumpab
                || isSimPinSecure());
    }

    private boolean getIsFaceAuthenticated() {
        boolean faceAuthenticated = false;
        BiometricAuthenticated bioFaceAuthenticated = mUserFaceAuthenticated.get(getCurrentUser());
        if (bioFaceAuthenticated != null) {
            faceAuthenticated = bioFaceAuthenticated.mAuthenticated;
        }
        return faceAuthenticated;
    }

    private void requireStrongAuthIfAllLockedOut() {
        final boolean faceLock =
                mFaceLockedOutPermanent || !shouldListenForFace();
                (mFaceLockedOutPermanent || !shouldListenForFace()) && !getIsFaceAuthenticated();
        final boolean fpLock =
                mFingerprintLockedOutPermanent || !shouldListenForFingerprint(isUdfpsEnrolled());

@@ -2240,6 +2249,9 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener, Dumpab
            strongAuthAllowsScanning = false;
        }

        // If the face has recently been authenticated do not attempt to authenticate again.
        boolean faceAuthenticated = getIsFaceAuthenticated();

        // Only listen if this KeyguardUpdateMonitor belongs to the primary user. There is an
        // instance of KeyguardUpdateMonitor for each user but KeyguardUpdateMonitor is user-aware.
        final boolean shouldListen =
@@ -2248,7 +2260,8 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener, Dumpab
                && !mSwitchingUser && !isFaceDisabled(user) && becauseCannotSkipBouncer
                && !mKeyguardGoingAway && mBiometricEnabledForUser.get(user) && !mLockIconPressed
                && strongAuthAllowsScanning && mIsPrimaryUser
                && (!mSecureCameraLaunched || mOccludingAppRequestingFace);
                && (!mSecureCameraLaunched || mOccludingAppRequestingFace)
                && !faceAuthenticated;

        // Aggregate relevant fields for debug logging.
        if (DEBUG_FACE || DEBUG_SPEW) {
@@ -2269,7 +2282,8 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener, Dumpab
                    mLockIconPressed,
                    strongAuthAllowsScanning,
                    mIsPrimaryUser,
                    mSecureCameraLaunched);
                    mSecureCameraLaunched,
                    faceAuthenticated);
            maybeLogFaceListenerModelData(model);
        }