mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
android: OTA fallback using the browser
Co-Authored-By: Frans de Jonge <fransdejonge@gmail.com>
This commit is contained in:
@@ -261,11 +261,18 @@ function OTAManager:fetchAndProcessUpdate()
|
||||
ok_callback = function()
|
||||
local isAndroid, android = pcall(require, "android")
|
||||
if isAndroid then
|
||||
-- download the package if not present.
|
||||
if android.download(link, ota_package) then
|
||||
android.notification(T(_("The file %1 already exists."), BD.filename(ota_package)))
|
||||
-- try to download the package
|
||||
local ok = android.download(link, ota_package)
|
||||
if ok == 1 then
|
||||
android.notification(T(_("The file %1 already exists."), ota_package))
|
||||
elseif ok == 0 then
|
||||
android.notification(T(_("Downloading %1"), ota_package))
|
||||
else
|
||||
android.notification(T(_("Downloading %1"), BD.filename(ota_package)))
|
||||
UIManager:show(ConfirmBox:new{
|
||||
text = _("Your device seems to be unable to download packages.\nRetry using the browser?"),
|
||||
ok_text = _("Retry"),
|
||||
ok_callback = function() Device:openLink(link) end,
|
||||
})
|
||||
end
|
||||
elseif Device:isSDL() then
|
||||
Device:openLink(link)
|
||||
|
||||
Submodule platform/android/luajit-launcher updated: e06b1089da...37ad1e4aca
Reference in New Issue
Block a user