mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
Android NetworkManager (#3386)
This commit is contained in:
@@ -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