Android: Apply command-line options again after the storage permission config reload

The reload reset them, so options passed through the Args extra (like
--pause-menu-exit) were lost before the game even started.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Henrik RydgårdandClaude Opus 5.5 committed 2026-10-20 12:27:59 +02:00
1 parent ae4b7983aa
commit f19ed3b2db
1 file changed
+5
+5
View File
@@ -209,6 +209,8 @@ static std::string g_savedAchievementsHost;
static bool g_savedAchievementsHardcoreMode = false;
static bool g_hasSavedAchievementsSettings = false;
static bool g_nativeMainThreadReady = false;
// Kept to apply again after a config reload.
static CommandLineOptions g_cmdLineOptions;
static std::mutex g_inputEventQueueLock;
static std::vector<QueuedEvent> g_inputEventQueue;
@@ -693,6 +695,7 @@ void NativeInit(int argc, const char *argv[], const CommandLineOptions &cmdLineO
// Apply parsed command line options to config.
cmdLineOptions.ApplyToConfig();
g_cmdLineOptions = cmdLineOptions;
boot_filename.clear();
if (boot_filename.empty() && cmdLineOptions.bootVSH.value_or(false)) {
@@ -1435,6 +1438,8 @@ bool HandleGlobalMessage(UIMessage message, const std::string &value) {
INFO_LOG(Log::IO, "Reloading config after storage permission grant.");
g_Config.Reload();
PostLoadConfig();
// The reload reset what the command line set.
g_cmdLineOptions.ApplyToConfig();
g_Config.iGPUBackend = gpuBackend;
return true;
} else if (message == UIMessage::APP_RESUMED || message == UIMessage::GOT_FOCUS) {