Skip to content

Commit

Permalink
Kobo: Explicitly murder Wi-Fi right before suspend if needed
Browse files Browse the repository at this point in the history
In order to avoid similar catch-22, no matter the timing
  • Loading branch information
NiLuJe committed Oct 11, 2024
1 parent 49cfd80 commit 75f7d86
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions frontend/device/kobo/device.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 75f7d86

Please sign in to comment.