cervantes kindle kobo remarkable: use sysfs carrier file to determine connection state
cleanup hasWifiManager checks
gateway check: use ip if available
Fixes: #10087Closes: #10092
-- NOTE: No -w flag available in the old busybox build used on Legacy Kindles...
ifDevice:isKindle()andDevice:hasKeyboard()then
return0==os.execute("ping -c1 "..default_gw)
else
return0==os.execute("ping -c1 -w2 "..default_gw)
end
end
end
functionNetworkMgr:isOnline()
localsocket=require("socket")
-- Microsoft uses `dns.msftncsi.com` for Windows, see
@ -308,8 +307,7 @@ function NetworkMgr:isNetworkInfoAvailable()
-- always available
returntrue
else
--- @todo also show network info when device is authenticated to router but offline
returnself:isWifiOn()
returnself:isConnected()
end
end
@ -499,7 +497,7 @@ function NetworkMgr:getPowersaveMenuTable()
text=_("Disable Wi-Fi connection when inactive"),
help_text=_([[This will automatically turn Wi-Fi off after a generous period of network inactivity, without disrupting workflows that require a network connection, so you can just keep reading without worrying about battery drain.]]),
-- NOTE: Well, not exactly, but the activity check wouldn't be (un)scheduled until the next Network(Dis)Connected event...
@ -513,7 +511,7 @@ function NetworkMgr:getRestoreMenuTable()
text=_("Restore Wi-Fi connection on resume"),
help_text=_([[This will attempt to automatically and silently re-connect to Wi-Fi on startup or on resume if Wi-Fi used to be enabled the last time you used KOReader.]]),