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

Commit 9f7fc271 authored by Steve Kondik's avatar Steve Kondik Committed by Gerrit Code Review
Browse files

keyguard: Allow disabling fingerprint wake-and-unlock

 * When the fingerprint sensor is embedded in the power key,
   wake-and-unlock is total chaos. Add an option to disable it.
 * The default behavior is unchanged.

Change-Id: I50c0a857daba92c17470d8089aca94099c792956
parent d6236bda
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -28,4 +28,10 @@

    <!-- Threshold in micro amperes above which a charger is rated as "fast" -->
    <integer name="config_chargingFastThreshold">1500000</integer>

    <!-- Should we listen for fingerprints when the screen is off?  Devices
         with a rear-mounted sensor want this, but certain devices have
         the sensor embedded in the power key and listening all the time
         causes a poor experience. -->
    <bool name="config_fingerprintWakeAndUnlock">true</bool>
</resources>
+10 −3
Original line number Diff line number Diff line
@@ -1050,9 +1050,16 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener {
    }

    private boolean shouldListenForFingerprint() {
        return (mKeyguardIsVisible || !mDeviceInteractive || mBouncer || mGoingToSleep)
                && !mSwitchingUser && !mFingerprintAlreadyAuthenticated
                && !isFingerprintDisabled(getCurrentUser());
        if (!mSwitchingUser && !mFingerprintAlreadyAuthenticated
                && !isFingerprintDisabled(getCurrentUser())) {
            if (mContext.getResources().getBoolean(
                    com.android.keyguard.R.bool.config_fingerprintWakeAndUnlock)) {
                return mKeyguardIsVisible || !mDeviceInteractive || mBouncer || mGoingToSleep;
            } else {
                return mDeviceInteractive && (mKeyguardIsVisible || mBouncer);
            }
        }
        return false;
    }

    private void startListeningForFingerprint() {