Android NetworkManager (#3386)
This commit is contained in:
1 parent
c573bdd610
commit
ff3d8f3df7
2 files changed
+11
-1
No files matched your search
@@ -51,4 +51,14 @@ function Device:init()
|
||||
Generic.init(self)
|
||||
end
|
||||
|
||||
function Device:initNetworkManager(NetworkMgr)
|
||||
NetworkMgr.turnOnWifi = function()
|
||||
android.setWifiEnabled(true)
|
||||
end
|
||||
|
||||
NetworkMgr.turnOffWifi = function()
|
||||
android.setWifiEnabled(false)
|
||||
end
|
||||
end
|
||||
|
||||
return Device
|
||||
@@ -82,7 +82,7 @@ end
|
||||
function NetworkMgr:getWifiMenuTable()
|
||||
return {
|
||||
text = _("Wi-Fi connection"),
|
||||
enabled_func = function() return Device:isKindle() or Device:isKobo() end,
|
||||
enabled_func = function() return Device:isAndroid() or Device:isKindle() or Device:isKobo() end,
|
||||
checked_func = function() return NetworkMgr:isOnline() end,
|
||||
callback = function(menu)
|
||||
local wifi_status = NetworkMgr:isOnline()
|
||||
|
||||
Reference in new issue
Block a user