NetworkManager: isWifiOn isConnected consistent usage.

cervantes kindle kobo remarkable: use sysfs carrier file to determine connection state

cleanup hasWifiManager checks

gateway check: use ip if available

Fixes: #10087
Closes: #10092
This commit is contained in:
yparitcher
2023-01-31 15:28:32 -05:00
parent 67d0808494
commit 0e53631f48
11 changed files with 80 additions and 107 deletions

View File

@@ -292,12 +292,13 @@ function Device:initNetworkManager(NetworkMgr)
android.openWifiSettings()
end
function NetworkMgr:isWifiOn()
function NetworkMgr:isConnected()
local ok = android.getNetworkInfo()
ok = tonumber(ok)
if not ok then return false end
return ok == 1
end
NetworkMgr.isWifiOn = NetworkMgr.isConnected
end
function Device:performHapticFeedback(type)