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

Commit 6e459523 authored by Steve Kondik's avatar Steve Kondik Committed by Jan Altensen
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
Signed-off-by: default avatarFrancescodario Cuzzocrea <bosconovic@gmail.com>
parent 8de2c310
Loading
Loading
Loading
Loading
+8 −1
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!--
     Copyright (C) 2018 The LineageOS Project
     Copyright (C) 2018-2021 The LineageOS Project

     Licensed under the Apache License, Version 2.0 (the "License");
     you may not use this file except in compliance with the License.
@@ -18,6 +19,12 @@
    <integer name="config_maxVisibleNotificationIcons">4</integer>
    <integer name="config_maxVisibleNotificationIconsOnLock">5</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>

    <!-- Color of the UDFPS pressed view -->
    <color name="config_udfpsColor">#ffffffff</color>

+17 −1
Original line number Diff line number Diff line
@@ -339,6 +339,8 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener, Dumpab
    private SensorPrivacyManager mSensorPrivacyManager;
    private int mFaceAuthUserId;

    private final boolean mFingerprintWakeAndUnlock;

    /**
     * Short delay before restarting fingerprint authentication after a successful try. This should
     * be slightly longer than the time between onFingerprintAuthenticated and
@@ -1809,6 +1811,8 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener, Dumpab
        mTelephonyListenerManager = telephonyListenerManager;
        mDeviceProvisioned = isDeviceProvisionedInSettingsDb();
        mStrongAuthTracker = new StrongAuthTracker(context, this::notifyStrongAuthStateChanged);
        mFingerprintWakeAndUnlock = mContext.getResources().getBoolean(
                com.android.systemui.R.bool.config_fingerprintWakeAndUnlock);
        mBackgroundExecutor = backgroundExecutor;
        mBroadcastDispatcher = broadcastDispatcher;
        mInteractionJankMonitor = interactionJankMonitor;
@@ -2276,7 +2280,18 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener, Dumpab
        final int user = getCurrentUser();
        final boolean userDoesNotHaveTrust = !getUserHasTrust(user);
        final boolean shouldListenForFingerprintAssistant = shouldListenForFingerprintAssistant();
        final boolean shouldListenKeyguardState =
        final boolean shouldListenKeyguardState;
        if (!mFingerprintWakeAndUnlock) {
            shouldListenKeyguardState =
                (mKeyguardIsVisible
                        || mBouncer
                        || shouldListenForFingerprintAssistant
                        || (mKeyguardOccluded && mIsDreaming))
                        && mDeviceInteractive && !mGoingToSleep && !mKeyguardGoingAway
                        || (mKeyguardOccluded && userDoesNotHaveTrust
                            && (mOccludingAppRequestingFp || isUdfps));
        } else {
            shouldListenKeyguardState =
                mKeyguardIsVisible
                        || !mDeviceInteractive
                        || (mBouncer && !mKeyguardGoingAway)
@@ -2285,6 +2300,7 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener, Dumpab
                        || (mKeyguardOccluded && mIsDreaming)
                        || (mKeyguardOccluded && userDoesNotHaveTrust
                            && (mOccludingAppRequestingFp || isUdfps));
        }

        // Only listen if this KeyguardUpdateMonitor belongs to the primary user. There is an
        // instance of KeyguardUpdateMonitor for each user but KeyguardUpdateMonitor is user-aware.