Skip to content

Commit 07abe53

Browse files
Steve KondikThe-DarkBeast
authored andcommitted
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
1 parent d257afe commit 07abe53

2 files changed

Lines changed: 21 additions & 5 deletions

File tree

packages/SystemUI/res/values/lineage_config.xml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,10 @@
2222
* Right -> 53 (Gravity.TOP | Gravity.RIGHT)
2323
-->
2424
<integer name="hardware_ui_align">53</integer>
25+
26+
<!-- Should we listen for fingerprints when the screen is off? Devices
27+
with a rear-mounted sensor want this, but certain devices have
28+
the sensor embedded in the power key and listening all the time
29+
causes a poor experience. -->
30+
<bool name="config_fingerprintWakeAndUnlock">true</bool>
2531
</resources>

packages/SystemUI/src/com/android/keyguard/KeyguardUpdateMonitor.java

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,7 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener {
224224
private LockPatternUtils mLockPatternUtils;
225225
private final IDreamManager mDreamManager;
226226
private boolean mIsDreaming;
227+
private final boolean mFingerprintWakeAndUnlock;
227228

228229
/**
229230
* Short delay before restarting fingerprint authentication after a successful try
@@ -1128,6 +1129,8 @@ private KeyguardUpdateMonitor(Context context) {
11281129
mSubscriptionManager = SubscriptionManager.from(context);
11291130
mDeviceProvisioned = isDeviceProvisionedInSettingsDb();
11301131
mStrongAuthTracker = new StrongAuthTracker(context);
1132+
mFingerprintWakeAndUnlock = mContext.getResources().getBoolean(
1133+
com.android.keyguard.R.bool.config_fingerprintWakeAndUnlock);
11311134

11321135
// Since device can't be un-provisioned, we only need to register a content observer
11331136
// to update mDeviceProvisioned when we are...
@@ -1228,11 +1231,18 @@ private boolean shouldListenForFingerprintAssistant() {
12281231
}
12291232

12301233
private boolean shouldListenForFingerprint() {
1231-
return (mKeyguardIsVisible || !mDeviceInteractive ||
1232-
(mBouncer && !mKeyguardGoingAway) || mGoingToSleep ||
1233-
shouldListenForFingerprintAssistant() || (mKeyguardOccluded && mIsDreaming))
1234-
&& !mSwitchingUser && !isFingerprintDisabled(getCurrentUser())
1235-
&& !mKeyguardGoingAway;
1234+
if (!mFingerprintWakeAndUnlock) {
1235+
return (mKeyguardIsVisible || mBouncer || shouldListenForFingerprintAssistant() ||
1236+
(mKeyguardOccluded && mIsDreaming)) && mDeviceInteractive && !mGoingToSleep
1237+
&& !mSwitchingUser && !isFingerprintDisabled(getCurrentUser())
1238+
&& !mKeyguardGoingAway;
1239+
} else {
1240+
return (mKeyguardIsVisible || !mDeviceInteractive ||
1241+
(mBouncer && !mKeyguardGoingAway) || mGoingToSleep ||
1242+
shouldListenForFingerprintAssistant() || (mKeyguardOccluded && mIsDreaming))
1243+
&& !mSwitchingUser && !isFingerprintDisabled(getCurrentUser())
1244+
&& !mKeyguardGoingAway;
1245+
}
12361246
}
12371247

12381248
private void startListeningForFingerprint() {

0 commit comments

Comments
 (0)