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

Commit a19d2993 authored by Beverly Tai's avatar Beverly Tai Committed by Automerger Merge Worker
Browse files

Merge "Don't overtrigger face auth (ie: goingToSleep, lockdown)" into tm-dev am: 4dcb654f

parents 676f86c8 4dcb654f
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -54,6 +54,7 @@ data class KeyguardFaceListenModel(
    val bouncerFullyShown: Boolean,
    val faceAuthenticated: Boolean,
    val faceDisabled: Boolean,
    val goingToSleep: Boolean,
    val keyguardAwake: Boolean,
    val keyguardGoingAway: Boolean,
    val listeningForFaceAssistant: Boolean,
+20 −7
Original line number Diff line number Diff line
@@ -628,7 +628,8 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener, Dumpab
     */
    public void setKeyguardGoingAway(boolean goingAway) {
        mKeyguardGoingAway = goingAway;
        updateBiometricListeningState(BIOMETRIC_ACTION_UPDATE);
        // This is set specifically to stop face authentication from running.
        updateBiometricListeningState(BIOMETRIC_ACTION_STOP);
    }

    /**
@@ -1746,7 +1747,8 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener, Dumpab
                cb.onFinishedGoingToSleep(arg1);
            }
        }
        updateBiometricListeningState(BIOMETRIC_ACTION_UPDATE);
        // This is set specifically to stop face authentication from running.
        updateBiometricListeningState(BIOMETRIC_ACTION_STOP);
    }

    private void handleScreenTurnedOff() {
@@ -1764,8 +1766,13 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener, Dumpab
                cb.onDreamingStateChanged(mIsDreaming);
            }
        }
        if (mIsDreaming) {
            updateFingerprintListeningState(BIOMETRIC_ACTION_UPDATE);
            updateFaceListeningState(BIOMETRIC_ACTION_STOP);
        } else {
            updateBiometricListeningState(BIOMETRIC_ACTION_UPDATE);
        }
    }

    private void handleUserInfoChanged(int userId) {
        Assert.isMainThread();
@@ -2477,9 +2484,11 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener, Dumpab
        boolean strongAuthAllowsScanning = (!isEncryptedOrTimedOut || canBypass
                && !mBouncerFullyShown);

        // If the device supports face detection (without authentication), allow it to happen
        // if the device is in lockdown mode. Otherwise, prevent scanning.
        // If the device supports face detection (without authentication) and bypass is enabled,
        // allow face scanning to happen if the device is in lockdown mode.
        // Otherwise, prevent scanning.
        final boolean supportsDetectOnly = !mFaceSensorProperties.isEmpty()
                && canBypass
                && mFaceSensorProperties.get(0).supportsFaceDetection;
        if (isLockDown && !supportsDetectOnly) {
            strongAuthAllowsScanning = false;
@@ -2494,8 +2503,11 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener, Dumpab
        // 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 =
                (mBouncerFullyShown || mAuthInterruptActive || mOccludingAppRequestingFace
                        || awakeKeyguard || shouldListenForFaceAssistant
                (mBouncerFullyShown && !mGoingToSleep
                        || mAuthInterruptActive
                        || mOccludingAppRequestingFace
                        || awakeKeyguard
                        || shouldListenForFaceAssistant
                        || mAuthController.isUdfpsFingerDown())
                && !mSwitchingUser && !faceDisabledForUser && becauseCannotSkipBouncer
                && !mKeyguardGoingAway && biometricEnabledForUser && !mLockIconPressed
@@ -2517,6 +2529,7 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener, Dumpab
                        mBouncerFullyShown,
                        faceAuthenticated,
                        faceDisabledForUser,
                        mGoingToSleep,
                        awakeKeyguard,
                        mKeyguardGoingAway,
                        shouldListenForFaceAssistant,
+1 −0
Original line number Diff line number Diff line
@@ -88,6 +88,7 @@ private fun faceModel(user: Int) = KeyguardFaceListenModel(
    bouncerFullyShown = false,
    faceAuthenticated = false,
    faceDisabled = false,
    goingToSleep = false,
    keyguardAwake = false,
    keyguardGoingAway = false,
    listeningForFaceAssistant = false,