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:
Martín Fernández
2024-06-25 21:35:38 +02:00
committed by GitHub
parent e26fdc7f14
commit 617618d587
9 changed files with 101 additions and 91 deletions

View File

@@ -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}