mirror of
https://github.com/koreader/koreader.git
synced 2025-12-13 20:36:53 +01:00
SDL: Return true in NetworkMgr:isConnected on !hasWifiToggle platforms, (#12217)
so as not to break the beforeWifiction shenanigans... Which is most of them, only the Emulator subclass sets it, for... reasons. (That Emulator quirk is also why we can't simply scrap the whole thing to use NetworkMgr's default imps). Fix #12203 (thanks to @benoit-pierre for spotting that one). This was clearly an oversight on my part when working on #10669
This commit is contained in:
@@ -396,6 +396,11 @@ end
|
||||
function Device:initNetworkManager(NetworkMgr)
|
||||
function NetworkMgr:isWifiOn() return true end
|
||||
function NetworkMgr:isConnected()
|
||||
if not Device:hasWifiToggle() then
|
||||
-- NOTE: This is necessary so as not to confuse NetworkMghr's beforeWifiAction framework.
|
||||
-- c.f., the default implementation in `NetworkMgr` itself for more details.
|
||||
return true
|
||||
end
|
||||
-- Pull the default gateway first, so we don't even try to ping anything if there isn't one...
|
||||
local default_gw = Device:getDefaultRoute()
|
||||
if not default_gw then
|
||||
|
||||
Reference in New Issue
Block a user