From 8bf19a73272751dbd97370af8bbcd8b17869854d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mart=C3=ADn=20Fdez?= Date: Fri, 13 Aug 2021 00:46:59 +0200 Subject: [PATCH] flush settings before being killed --- frontend/device/android/device.lua | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/frontend/device/android/device.lua b/frontend/device/android/device.lua index ecf8e1371..93ac46b09 100644 --- a/frontend/device/android/device.lua +++ b/frontend/device/android/device.lua @@ -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