From 99ad13b13c896eeca0c1d41b957d05e61d3ab9de Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mart=C3=ADn=20Fern=C3=A1ndez?= Date: Thu, 22 Oct 2020 20:18:36 +0200 Subject: [PATCH] android: handle onDestroy (#6811) * handle onDestroy we need it if killed by the system (ie: battery optimizations or OOM) we need it to exit the lua VM when we call finish() from Kotlin This prevents us for being trapped into a zombie state --- base | 2 +- frontend/device/android/device.lua | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/base b/base index 5f9e9b7eb..afdd59b20 160000 --- a/base +++ b/base @@ -1 +1 @@ -Subproject commit 5f9e9b7eb39fc98cdacba52d081fe2b559fcfb33 +Subproject commit afdd59b2048bde27536bef07e754102840f63850 diff --git a/frontend/device/android/device.lua b/frontend/device/android/device.lua index c5530ffd5..7081cd28b 100644 --- a/frontend/device/android/device.lua +++ b/frontend/device/android/device.lua @@ -134,6 +134,8 @@ function Device:init() logger.dbg("Android application event", ev.code) if ev.code == C.APP_CMD_SAVE_STATE then return "SaveState" + elseif ev.code == C.APP_CMD_DESTROY then + UIManager:quit() elseif ev.code == C.APP_CMD_GAINED_FOCUS or ev.code == C.APP_CMD_INIT_WINDOW or ev.code == C.APP_CMD_WINDOW_REDRAW_NEEDED then