mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
display network settings based on device capabilities + fix android basic network info
This commit is contained in:
committed by
Frans de Jonge
parent
f3a36f8285
commit
04e17424d0
@@ -1,9 +1,11 @@
|
||||
local Generic = require("device/generic/device")
|
||||
local _, android = pcall(require, "android")
|
||||
local A, android = pcall(require, "android") -- luacheck: ignore
|
||||
local ffi = require("ffi")
|
||||
local C = ffi.C
|
||||
local lfs = require("libs/libkoreader-lfs")
|
||||
local logger = require("logger")
|
||||
local _ = require("gettext")
|
||||
local T = require("ffi/util").template
|
||||
|
||||
local function yes() return true end
|
||||
local function no() return false end
|
||||
@@ -90,6 +92,15 @@ function Device:initNetworkManager(NetworkMgr)
|
||||
end
|
||||
end
|
||||
|
||||
function Device:retrieveNetworkInfo()
|
||||
local ssid, ip, gw = android.getNetworkInfo()
|
||||
if ip == 0 or gw == 0 then
|
||||
return _("Not connected")
|
||||
else
|
||||
return T(_("Connected to %1\n IP address: %2\n gateway: %3"), ssid, ip, gw)
|
||||
end
|
||||
end
|
||||
|
||||
function Device:exit()
|
||||
android.log_name = 'luajit-launcher'
|
||||
android.LOGI("Finishing luajit launcher main activity");
|
||||
|
||||
Reference in New Issue
Block a user