[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), display_dpi = android.lib.AConfiguration_getDensity(android.app.config),
hasClipboard = yes, hasClipboard = yes,
hasColorScreen = yes, hasColorScreen = yes,
hasOTAUpdates = yes,
} }
function Device:init() function Device:init()

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

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

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

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

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

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

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

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

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

Loading…
Cancel
Save