From 27cadb24f3b9feacc0312b89632cd8555c3db588 Mon Sep 17 00:00:00 2001 From: xbzk Date: Tue, 14 Apr 2026 00:21:51 +0200 Subject: [PATCH] [android, intent] Run restoreContentForGame for shortcut launching + Improve custom settings context for shortcut launching (based on normal launch) (#3854) intended to fix two bugs identified by Pavel upon android shortcut launching (and prolly all FEs since the rely on intent launching too): 1. external content not loading: fixed by running restoreContentForGame for per game mount in content path. 2. custom settings no loading: that was proven to be user side, but adjustments were made to match normal launch. should be harmless for normal usage. once validated can be merged. Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/3854 Reviewed-by: CamilleLaVey Co-authored-by: xbzk Co-committed-by: xbzk --- .../org/yuzu/yuzu_emu/fragments/EmulationFragment.kt | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/android/app/src/main/java/org/yuzu/yuzu_emu/fragments/EmulationFragment.kt b/src/android/app/src/main/java/org/yuzu/yuzu_emu/fragments/EmulationFragment.kt index a4c9eb9039..19dbe288bb 100644 --- a/src/android/app/src/main/java/org/yuzu/yuzu_emu/fragments/EmulationFragment.kt +++ b/src/android/app/src/main/java/org/yuzu/yuzu_emu/fragments/EmulationFragment.kt @@ -291,13 +291,23 @@ class EmulationFragment : Fragment(), SurfaceHolder.Callback { // Game launched via intent (check for existing custom config) intentGame != null -> { game?.let { gameInstance -> + runCatching { GameHelper.restoreContentForGame(gameInstance) } + .onFailure { + Log.warning( + "[EmulationFragment] Failed to restore content for intent launch: ${it.message}" + ) + } + val customConfigFile = SettingsFile.getCustomSettingsFile(gameInstance) if (customConfigFile.exists()) { + shouldUseCustom = true Log.info( "[EmulationFragment] Found existing custom settings for ${gameInstance.title}, loading them" ) SettingsFile.loadCustomConfig(gameInstance) + NativeConfig.unloadPerGameConfig() } else { + shouldUseCustom = false Log.info( "[EmulationFragment] No custom settings found for ${gameInstance.title}, using global settings" ) @@ -871,7 +881,7 @@ class EmulationFragment : Fragment(), SurfaceHolder.Callback { if (drawerView == binding.quickSettingsSheet) { isQuickSettingsMenuOpen = true if (shouldUseCustom) { - SettingsFile.loadCustomConfig(args.game!!) + SettingsFile.loadCustomConfig(game!!) } } }