mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
Partial fix for 3477 (#3568)
Partial, as it will safe the state when suspending the reader by pressing the power-button. However, it will still not safe the state when Pocketbooks autoPowerOff-Feature kicks in, as this does not create an event (e.g. no EVT_BACKGROUND) of any kind. * Clean up device.lua * Save state on suspend
This commit is contained in:
committed by
Frans de Jonge
parent
22a8cfde7c
commit
88c03c08d1
@@ -74,6 +74,16 @@ function UIManager:init()
|
||||
Device:reboot()
|
||||
end)
|
||||
end
|
||||
if Device:isPocketBook() then
|
||||
self.event_handlers["Suspend"] = function()
|
||||
self:_beforeSuspend()
|
||||
Device:onPowerEvent("Power")
|
||||
end
|
||||
self.event_handlers["Resume"] = function()
|
||||
Device:onPowerEvent("Power")
|
||||
self:_afterResume()
|
||||
end
|
||||
end
|
||||
if Device:isKobo() then
|
||||
-- We do not want auto suspend procedure to waste battery during
|
||||
-- suspend. So let's unschedule it when suspending, and restart it after
|
||||
|
||||
Reference in New Issue
Block a user