mirror of
https://github.com/koreader/koreader.git
synced 2025-12-13 20:36:53 +01:00
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:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user