mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
Kobo: Explicitly murder Wi-Fi right before suspend if needed
In order to avoid similar catch-22, no matter the timing
This commit is contained in:
@@ -1344,6 +1344,14 @@ function Kobo:suspend()
|
||||
return
|
||||
end
|
||||
|
||||
-- Murder Wi-Fi (again, c.f., `Device:onPowerEvent`) if NetworkMgr is attempting to connect or currently connected...
|
||||
-- (Most likely because of a rerunWhenOnline in a Suspend handler)
|
||||
local network_mgr = require("ui/network/manager")
|
||||
if network_mgr:isWifiOn() or network_mgr.pending_connection then
|
||||
logger.info("Kobo suspend: had to kill Wi-Fi")
|
||||
network_mgr:disableWifi()
|
||||
end
|
||||
|
||||
logger.info("Kobo suspend: going to sleep . . .")
|
||||
UIManager:unschedule(self.checkUnexpectedWakeup)
|
||||
-- NOTE: Sleep as little as possible here, sleeping has a tendency to make
|
||||
|
||||
Reference in New Issue
Block a user