summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteve Kondik <steve@cyngn.com>2016-05-02 04:01:43 -0700
committerMichael Bestas <mkbestas@lineageos.org>2019-11-17 11:48:08 +0100
commit091f2e21eb3a8387f90e30af4047a78958985e89 (patch)
treec87814b9ffbdc3d670f6c12312cd12c7e10122ac
parentb741caaeb3867e4c93540185813c98379fbcc24a (diff)
downloadandroid_frameworks_base-091f2e21eb3a8387f90e30af4047a78958985e89.tar.gz
android_frameworks_base-091f2e21eb3a8387f90e30af4047a78958985e89.tar.bz2
android_frameworks_base-091f2e21eb3a8387f90e30af4047a78958985e89.zip
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
-rw-r--r--packages/SystemUI/res/values/lineage_config.xml9
-rw-r--r--packages/SystemUI/src/com/android/keyguard/KeyguardUpdateMonitor.java22
2 files changed, 24 insertions, 7 deletions
diff --git a/packages/SystemUI/res/values/lineage_config.xml b/packages/SystemUI/res/values/lineage_config.xml
index 242950c63db..2ee6d40097b 100644
--- a/packages/SystemUI/res/values/lineage_config.xml
+++ b/packages/SystemUI/res/values/lineage_config.xml
@@ -1,5 +1,6 @@
+<?xml version="1.0" encoding="utf-8"?>
<!--
- Copyright (C) 2018 The LineageOS Project
+ Copyright (C) 2018-2019 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.
@@ -28,4 +29,10 @@
<!-- Max visible notification icons -->
<integer name="config_maxVisibleNotificationIcons">4</integer>
<integer name="config_maxVisibleNotificationIconsWhenDark">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>
</resources>
diff --git a/packages/SystemUI/src/com/android/keyguard/KeyguardUpdateMonitor.java b/packages/SystemUI/src/com/android/keyguard/KeyguardUpdateMonitor.java
index 6a4dbc8d722..e5f4a11ba4c 100644
--- a/packages/SystemUI/src/com/android/keyguard/KeyguardUpdateMonitor.java
+++ b/packages/SystemUI/src/com/android/keyguard/KeyguardUpdateMonitor.java
@@ -241,6 +241,8 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener {
// If the user long pressed the lock icon, disabling face auth for the current session.
private boolean mLockIconPressed;
+ private final boolean mFingerprintWakeAndUnlock;
+
/**
* Short delay before restarting biometric authentication after a successful try
* This should be slightly longer than the time between on<biometric>Authenticated
@@ -1435,6 +1437,8 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener {
mSubscriptionManager = SubscriptionManager.from(context);
mDeviceProvisioned = isDeviceProvisionedInSettingsDb();
mStrongAuthTracker = new StrongAuthTracker(context, this::notifyStrongAuthStateChanged);
+ mFingerprintWakeAndUnlock = mContext.getResources().getBoolean(
+ com.android.keyguard.R.bool.config_fingerprintWakeAndUnlock);
// Since device can't be un-provisioned, we only need to register a content observer
// to update mDeviceProvisioned when we are...
@@ -1613,12 +1617,18 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener {
private boolean shouldListenForFingerprint() {
// 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 = (mKeyguardIsVisible || !mDeviceInteractive ||
- (mBouncer && !mKeyguardGoingAway) || mGoingToSleep ||
- shouldListenForFingerprintAssistant() || (mKeyguardOccluded && mIsDreaming))
- && !mSwitchingUser && !isFingerprintDisabled(getCurrentUser())
- && (!mKeyguardGoingAway || !mDeviceInteractive) && mIsPrimaryUser;
- return shouldListen;
+ if (!mFingerprintWakeAndUnlock) {
+ return (mKeyguardIsVisible || mBouncer || shouldListenForFingerprintAssistant() ||
+ (mKeyguardOccluded && mIsDreaming)) && mDeviceInteractive && !mGoingToSleep
+ && !mSwitchingUser && !isFingerprintDisabled(getCurrentUser())
+ && (!mKeyguardGoingAway || !mDeviceInteractive) && mIsPrimaryUser;
+ } else {
+ return (mKeyguardIsVisible || !mDeviceInteractive ||
+ (mBouncer && !mKeyguardGoingAway) || mGoingToSleep ||
+ shouldListenForFingerprintAssistant() || (mKeyguardOccluded && mIsDreaming))
+ && !mSwitchingUser && !isFingerprintDisabled(getCurrentUser())
+ && (!mKeyguardGoingAway || !mDeviceInteractive) && mIsPrimaryUser;
+ }
}
private boolean shouldListenForFace() {