mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-08-02 03:28:28 -04:00
lock/pam: attempt to fix fprintd retry spam after resume
This commit is contained in:
@@ -779,7 +779,7 @@ Item {
|
||||
return "passkey";
|
||||
if (pam.fprint.tries >= SettingsData.maxFprintTries)
|
||||
return "fingerprint_off";
|
||||
if (pam.fprint.active)
|
||||
if (pam.fprint.active || pam.fprint.retrying)
|
||||
return "fingerprint";
|
||||
if (pam.u2f.active)
|
||||
return "passkey";
|
||||
|
||||
@@ -262,9 +262,11 @@ Scope {
|
||||
property bool available: SettingsData.lockFingerprintReady
|
||||
property int tries
|
||||
property int errorTries
|
||||
property bool retrying: false
|
||||
|
||||
function checkAvail(): void {
|
||||
if (!available || !SettingsData.enableFprint || !root.lockSecured || root.fprintSuppressedByPrimaryPam) {
|
||||
retrying = false;
|
||||
abort();
|
||||
return;
|
||||
}
|
||||
@@ -273,6 +275,7 @@ Scope {
|
||||
|
||||
tries = 0;
|
||||
errorTries = 0;
|
||||
retrying = false;
|
||||
start();
|
||||
}
|
||||
|
||||
@@ -285,6 +288,7 @@ Scope {
|
||||
|
||||
switch (res) {
|
||||
case PamResult.Success:
|
||||
retrying = false;
|
||||
if (!root.unlockInProgress) {
|
||||
passwd.abort();
|
||||
root.proceedAfterPrimaryAuth();
|
||||
@@ -293,13 +297,16 @@ Scope {
|
||||
case PamResult.Error:
|
||||
errorTries++;
|
||||
if (errorTries < 200) {
|
||||
retrying = true;
|
||||
abort();
|
||||
errorRetry.restart();
|
||||
return;
|
||||
}
|
||||
retrying = false;
|
||||
abort();
|
||||
return;
|
||||
case PamResult.MaxTries:
|
||||
retrying = false;
|
||||
tries++;
|
||||
if (tries < SettingsData.maxFprintTries) {
|
||||
root.fprintState = "fail";
|
||||
@@ -418,7 +425,7 @@ Scope {
|
||||
Timer {
|
||||
id: errorRetry
|
||||
|
||||
interval: 1500
|
||||
interval: Math.min(1500 * Math.pow(2, Math.max(0, fprint.errorTries - 1)), 30000)
|
||||
onTriggered: fprint.start()
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user