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

This commit is contained in:
Martín Fernández
2018-10-06 07:55:35 +02:00
committed by Frans de Jonge
parent b9baa10d22
commit b8d95984d1
10 changed files with 13 additions and 6 deletions

View File

@@ -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()

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -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",
"----------------------------",

View File

@@ -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",
"----------------------------",

View File

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