mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
flush settings before being killed
This commit is contained in:
committed by
Frans de Jonge
parent
ace3f0ee16
commit
8bf19a7327
@@ -136,7 +136,7 @@ function Device:init()
|
||||
local UIManager = require("ui/uimanager")
|
||||
logger.dbg("Android application event", ev.code)
|
||||
if ev.code == C.APP_CMD_SAVE_STATE then
|
||||
UIManager:broadcastEvent(Event:new("SaveSettings"))
|
||||
UIManager:broadcastEvent(Event:new("FlushSettings"))
|
||||
elseif ev.code == C.APP_CMD_DESTROY then
|
||||
UIManager:quit()
|
||||
elseif ev.code == C.APP_CMD_GAINED_FOCUS
|
||||
@@ -490,9 +490,11 @@ function Device:install()
|
||||
text = _("Update is ready. Install it now?"),
|
||||
ok_text = _("Install"),
|
||||
ok_callback = function()
|
||||
UIManager:broadcastEvent(Event:new("SaveSettings"))
|
||||
android.ota.install()
|
||||
android.ota.isPending = false
|
||||
UIManager:broadcastEvent(Event:new("FlushSettings"))
|
||||
UIManager:tickAfterNext(function()
|
||||
android.ota.install()
|
||||
android.ota.isPending = false
|
||||
end)
|
||||
end,
|
||||
})
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user