Skip to content

Commit afd7f68

Browse files
committed
Fix emulator auto-detection not running before game launch
Emulators were only detected when visiting GameDetail or Settings screens. Launching from HomeScreen would fail with "no emulator installed" because the installed emulators list was empty. Now triggers detection lazily in GameLauncher.resolveEmulator() if the emulator list is empty.
1 parent 3c89635 commit afd7f68

2 files changed

Lines changed: 6 additions & 2 deletions

File tree

app/build.gradle.kts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ android {
2222
applicationId = "com.nendo.argosy"
2323
minSdk = 26
2424
targetSdk = 34
25-
versionCode = 8
26-
versionName = "0.5.1"
25+
versionCode = 9
26+
versionName = "0.5.2"
2727

2828
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
2929
vectorDrawables {

app/src/main/kotlin/com/nendo/argosy/data/emulator/GameLauncher.kt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,10 @@ class GameLauncher @Inject constructor(
6565
return EmulatorRegistry.getByPackage(platformDefault.packageName)
6666
}
6767

68+
if (emulatorDetector.installedEmulators.value.isEmpty()) {
69+
emulatorDetector.detectEmulators()
70+
}
71+
6872
return emulatorDetector.getPreferredEmulator(game.platformId)?.def
6973
}
7074

0 commit comments

Comments
 (0)