mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
Add Device:otaModel() (#12014)
Devices with a single target might want to specify it in `Device.ota_model` Devices with multiple targets want to override the function or to specify `ota_model` variants for each target.
This commit is contained in:
@@ -116,6 +116,22 @@ local Device = Generic:extend{
|
||||
end,
|
||||
}
|
||||
|
||||
function Device:otaModel()
|
||||
-- "x86", "x64", "arm", "arm64", "ppc", "mips" or "mips64".
|
||||
local arch = jit.arch
|
||||
local model
|
||||
if arch == "arm64" then
|
||||
model = "android-arm64"
|
||||
elseif arch == "x86" then
|
||||
model = "android-x86"
|
||||
elseif arch == "x64" then
|
||||
model = "android-x86_64"
|
||||
else
|
||||
model = "android"
|
||||
end
|
||||
return model, "link"
|
||||
end
|
||||
|
||||
function Device:init()
|
||||
self.screen = require("ffi/framebuffer_android"):new{device = self, debug = logger.dbg}
|
||||
self.powerd = require("device/android/powerd"):new{device = self}
|
||||
|
||||
Reference in New Issue
Block a user