[UX] Show OTA updates only on supported devices (#4256)

pull/4269/head v2018.10.07-beta
Martín Fernández 6 years ago committed by Frans de Jonge
parent b9baa10d22
commit b8d95984d1

@ -17,6 +17,7 @@ local Device = Generic:new{
display_dpi = android.lib.AConfiguration_getDensity(android.app.config),
hasClipboard = yes,
hasColorScreen = yes,
hasOTAUpdates = yes,
}
function Device:init()

@ -51,6 +51,9 @@ local Device = {
-- but is actually a color eInk screen with 24bit per pixel.
-- The refresh is still based on bytes. (This solves issue #4193.)
has3BytesWideFrameBuffer = no,
-- set to yes on devices that support over-the-air incremental updates.
hasOTAUpdates = no,
}
function Device:new(o)

@ -51,6 +51,7 @@ local Kindle = Generic:new{
isKindle = yes,
-- NOTE: We can cheat by adding a platform-specific entry here, because the only code that will check for this is here.
isSpecialOffers = isSpecialOffers(),
hasOTAUpdates = yes,
}
function Kindle:initNetworkManager(NetworkMgr)

@ -24,6 +24,7 @@ local Kobo = Generic:new{
isKobo = yes,
isTouchDevice = yes, -- all of them are
hasBGRFrameBuffer = yes, -- True when >16bpp
hasOTAUpdates = yes,
-- most Kobos have X/Y switched for the touch screen
touch_switch_xy = true,

@ -54,6 +54,7 @@ local PocketBook = Generic:new{
model = "PocketBook",
isPocketBook = yes,
isInBackGround = false,
hasOTAUpdates = yes,
}
function PocketBook:init()

@ -10,6 +10,7 @@ local SonyPRSTUX = Generic:new{
model = "Sony PRSTUX",
isSonyPRSTUX = yes,
hasKeys = yes,
hasOTAUpdates = yes,
}

@ -7,8 +7,7 @@ local T = require("ffi/util").template
local common_info = {}
if Device:isKindle() or Device:isKobo() or Device:isPocketBook()
or Device:isAndroid() then
if Device:hasOTAUpdates() then
local OTAManager = require("ui/otamanager")
common_info.ota_update = OTAManager:getOTAMenuTable()
end

@ -93,8 +93,7 @@ local order = {
"----------------------------",
"system_statistics",
"----------------------------",
"ota_update", --[[ if Device:isKindle() or Device:isKobo() or
Device:isPocketBook() or Device:isAndroid() ]]--
"ota_update", -- if Device:hasOTAUpdates()
"version",
"help",
"----------------------------",

@ -114,8 +114,7 @@ local order = {
"----------------------------",
"system_statistics",
"----------------------------",
"ota_update", --[[ if Device:isKindle() or Device:isKobo() or
Device:isPocketBook() or Device:isAndroid() ]]--
"ota_update", -- if Device:hasOTAUpdates()
"version",
"help",
"----------------------------",

@ -57,6 +57,8 @@ function OTAManager:getOTAModel()
return "pocketbook"
elseif Device:isAndroid() then
return "android"
elseif Device:isSonyPRSTUX() then
return "sony-prstux"
else
return ""
end

Loading…
Cancel
Save