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