From b7ff3e508bf3fc0db5de760333a952066386d1db Mon Sep 17 00:00:00 2001 From: Leon Styhre Date: Fri, 2 Feb 2024 19:58:15 +0100 Subject: [PATCH] (Android) Fixed an issue where re-running the configurator would wipe the es_settings.xml file --- es-app/src/main.cpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/es-app/src/main.cpp b/es-app/src/main.cpp index e2b0ae1ce..50ebefdfb 100644 --- a/es-app/src/main.cpp +++ b/es-app/src/main.cpp @@ -578,6 +578,8 @@ int main(int argc, char* argv[]) #endif #if defined(__ANDROID__) + bool resetTouchOverlay {false}; + if (Utils::Platform::Android::checkConfigurationNeeded()) { Utils::Platform::Android::startConfigurator(); @@ -588,10 +590,7 @@ int main(int argc, char* argv[]) exit(0); // Always enable the touch overlay after running the configurator. - if (!Settings::getInstance()->getBool("InputTouchOverlay")) { - Settings::getInstance()->setBool("InputTouchOverlay", true); - Settings::getInstance()->saveFile(); - } + resetTouchOverlay = true; } Utils::Platform::Android::setDataDirectories(); @@ -739,6 +738,13 @@ int main(int argc, char* argv[]) } } +#if defined(__ANDROID__) + if (resetTouchOverlay) { + Settings::getInstance()->setBool("InputTouchOverlay", true); + Settings::getInstance()->saveFile(); + } +#endif + { // Check if the application release number has changed, which would normally mean that the // user has upgraded to a new version.