Fix Kindle crash on AutoSuspend while charging (#14604)

This commit is contained in:
DemonicSavage
2025-11-11 11:00:16 -03:00
committed by GitHub
parent 76eeed1cb4
commit 016b3ed6b5

View File

@@ -137,6 +137,12 @@ if Device:isKindle() then
return
end
-- Also causes problems when charging.
if PowerD:isCharging() and not PowerD:isCharged() then
logger.dbg("AutoSuspend: Device is charging, 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.