Fix crash on Kindle when both AutoSuspend and KeepAlive are on (#14594)

KeepAlive disable t1 timeout by disabling screensaver in powerd, so we must not reset it then.

Fixes #14548.
This commit is contained in:
DemonicSavage
2025-11-10 05:35:38 -03:00
committed by GitHub
parent 3c8a312c9e
commit 60a5309452

View File

@@ -130,6 +130,13 @@ if Device:isKindle() then
return
end
-- KeepAlive on Kindles work by disabling screensaver in powerd. As this makes the t1 timeout behave wackily,
-- we must not reset it, as it causes a crash.
if PluginShare.keepalive then
logger.dbg("AutoSuspend: KeepAlive is active, skipping t1 timeout reset")
return
end
local now = UIManager:getElapsedTimeSinceBoot()
local kindle_t1_reset_seconds = default_kindle_t1_timeout_reset_seconds - time.to_number(now - self.last_t1_reset_time)
-- NOTE: Unlike us, powerd doesn't care about charging, so we always use the delta since the last user input.