Device: Add some more logging in onPowerEvent

Could possibly help shed some light on potential SleepCover races...
re #7633
reviewable/pr7658/r1
NiLuJe 3 years ago
parent 2635593890
commit 48c474e245

@ -270,6 +270,8 @@ function Device:onPowerEvent(ev)
self.powerd:beforeSuspend()
local UIManager = require("ui/uimanager")
logger.dbg("Suspending...")
-- Add the current state of the SleepCover flag...
logger.dbg("Sleep cover is", self.is_cover_closed and "closed" or "open")
-- Let Screensaver set its widget up, so we get accurate info down the line in case fallbacks kick in...
Screensaver:setup()
-- Mostly always suspend in Portrait/Inverted Portrait mode...
@ -325,7 +327,11 @@ function Device:onPowerEvent(ev)
network_manager:turnOffWifi()
end
end
UIManager:scheduleIn(self.suspend_wait_timeout, self.suspend)
-- Only actually schedule suspension if we're still supposed to go to sleep,
-- because the Wi-Fi stuff above may have blocked for a significant amount of time...
if self.screen_saver_mode then
UIManager:scheduleIn(self.suspend_wait_timeout, self.suspend)
end
end)
end
end

Loading…
Cancel
Save