Skip to main content

Reset auto-lock idle timer (device.reset_idle)

Declaration

device.reset_idle()

Description

Reset the auto-lock idle timer (keep screen awake)
Avoid calling too frequently. More than 10 calls per second may crash the service or system.

Example

-- Dispatch a task to reset idle every 29 seconds
thread.dispatch(function()
while 1 do
device.reset_idle()
sys.msleep(29 * 1000)
end
end)

Note: Uses functions outside this chapter thread.dispatch, sys.msleep