[ota]: deprecation check & notice (#10639)

This commit is contained in:
Martín Fernández authored and GitHub committed 2023-07-04 22:58:40 +02:00
1 parent 346d8eb83e
commit 5336e2f11d
3 files changed
+11

No files matched your search

+4
View File
@@ -450,6 +450,10 @@ function Device:info()
return common_text..platform_text..eink_text..wakelocks_text
end
function Device:isDeprecated()
return self.firmware_rev < 18
end
function Device:test()
android.runTest()
end
+1
View File
@@ -48,6 +48,7 @@ local Device = {
hasWifiManager = no,
isDefaultFullscreen = yes,
isHapticFeedbackEnabled = no,
isDeprecated = no, -- device no longer receive OTA updates
isTouchDevice = no,
hasFrontlight = no,
hasNaturalLight = no, -- FL warmth implementation specific to NTX boards (Kobo, Cervantes)
+6
View File
@@ -153,6 +153,8 @@ function OTAManager:getZsyncFilename()
end
function OTAManager:checkUpdate()
if Device:isDeprecated() then return -1 end
local http = require("socket.http")
local ltn12 = require("ltn12")
local socket = require("socket")
@@ -227,6 +229,10 @@ function OTAManager:fetchAndProcessUpdate()
UIManager:show(InfoMessage:new{
text = _("KOReader is up to date."),
})
elseif ota_version == -1 then
UIManager:show(InfoMessage:new{
text = T(_("Device no longer supported.\n\nPlease check %1"), "https://github.com/koreader/koreader/wiki/deprecated-devices")
})
elseif ota_version == nil then
local channel = ota_channels[OTAManager:getOTAChannel()]
UIManager:show(InfoMessage:new{