Skip to main content

idle_secs_with_lock

Function idle_secs_with_lock 

Source
pub(super) fn idle_secs_with_lock(
    raw_idle_secs: u64,
    locked: Option<bool>,
    s: &Settings,
) -> u64
Expand description

Pure decision: given the raw HID-idle seconds and an Option<bool> lock signal, return the idle seconds the rest of the scheduler should see. When the OS confidently reports the session as locked, promote the value past both the micro- and long-break reset thresholds so every downstream check (screen-time, suppression, typing-defer) treats the user as idle. None (couldn’t determine lock state) leaves raw_idle_secs untouched — trust HID alone.