Repository navigation
Lock screen: give the first wake after a blank a 15-second grace #17544
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: quattro
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -237,6 +237,55 @@ ShellRoot { | |
| check(!service.fingerprintPaused, "unlock reset clears a pause so the next lock starts the reader") | ||
| service.applyFingerprintProbe("Daemon is restarting") | ||
| check(!recheck.running, "an unknown probe outside the lock cannot restart it") | ||
|
|
||
| // First wake after blank grants a longer grace so the user can type | ||
| // before reblanking; bursts of wake input preserve that countdown. Move | ||
| // the armed countdown back 7s so the burst reads as seconds after the | ||
| // first wake even though both run inside the same wall-clock | ||
| // millisecond: a burst that reset or re-granted the countdown would | ||
| // move its deadline and fail the exact match. | ||
| service.lockRequested = true | ||
| service.runBlank() | ||
| service.runWake() | ||
| check(blankTimer.interval === 15000, "first wake after a blank arms the longer grace") | ||
| blankTimer.armedAt -= 7000 | ||
| var initialDeadline = blankTimer.armedAt + blankTimer.interval | ||
| blankTimer.stop() | ||
|
|
||
| blankTimer.start() | ||
| service.runWake() | ||
| service.runWake() | ||
| check(blankTimer.interval === 15000 && blankTimer.armedAt + blankTimer.interval === initialDeadline, | ||
| "burst of wake inputs preserves the long grace deadline") | ||
|
|
||
| blankTimer.armedAt = Date.now() - 11000 | ||
| service.runWake() | ||
| check(blankTimer.interval === 5000, "wake input once less than 5s of the grace remains re-arms the normal 5s interval") | ||
| blankTimer.stop() | ||
| service.runWake() | ||
| check(blankTimer.interval === 5000, "input ending a password check arms the normal 5s run-up even with grace left over") | ||
|
Comment on lines
+264
to
+266
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
The preceding check has already changed Arm a fresh 15-second grace before stopping the timer, then check that ending the password check starts the normal 5-second countdown. |
||
|
|
||
| // A resume arms the same longer countdown, through the blank timer's | ||
| // own suspend-gap check; the wake paths that fire within a second of | ||
| // the resume must not reset it to the idle run-up. | ||
| blankTimer.interval = 5000 | ||
| blankTimer.armedAt = Date.now() - 60000 | ||
| blankTimer.start() | ||
| blankTimer.triggered() | ||
| check(blankTimer.interval === 15000, "a countdown frozen by suspend re-arms the resume grace instead of blanking") | ||
| service.armBlankTimer() | ||
| check(blankTimer.interval === 15000, "an output re-detection right after a resume keeps the resume grace") | ||
| service.runWake() | ||
| check(blankTimer.interval === 15000, "a wake burst right after a resume keeps the resume grace") | ||
| blankTimer.armedAt = Date.now() - 11000 | ||
| service.runWake() | ||
| check(blankTimer.interval === 5000, "input once the resume grace is mostly spent re-arms the normal 5s interval") | ||
| blankTimer.stop() | ||
|
|
||
| service.runBlank() | ||
| service.runWake() | ||
| check(blankTimer.interval === 15000, "wake after blanking again arms the longer grace") | ||
| blankTimer.stop() | ||
| } finally { | ||
| service.lockRequested = false | ||
| service.resetAuthenticationState() | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.