From 016b3ed6b5a1ab6398b5e4241eea8cb548e8daf3 Mon Sep 17 00:00:00 2001 From: DemonicSavage Date: Tue, 11 Nov 2025 11:00:16 -0300 Subject: [PATCH] Fix Kindle crash on AutoSuspend while charging (#14604) --- plugins/autosuspend.koplugin/main.lua | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/plugins/autosuspend.koplugin/main.lua b/plugins/autosuspend.koplugin/main.lua index d2b211054..4394ff5a1 100644 --- a/plugins/autosuspend.koplugin/main.lua +++ b/plugins/autosuspend.koplugin/main.lua @@ -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.