From 2c6a975d1f88b68bf276d3061a4540481ef25ad0 Mon Sep 17 00:00:00 2001 From: JosJuice Date: Mon, 28 Jan 2019 20:16:48 +0100 Subject: [PATCH 1/2] Android: Use SelectedGames instead of SelectedGame in StartupHandler Regression from the automatic disc change PR. See https://forums.dolphin-emu.org/Thread-commit-63c9831-broke-game-autostarting-on-android --- .../java/org/dolphinemu/dolphinemu/utils/StartupHandler.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/utils/StartupHandler.java b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/utils/StartupHandler.java index 5fcc384459..2e473eb828 100644 --- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/utils/StartupHandler.java +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/utils/StartupHandler.java @@ -37,7 +37,7 @@ public final class StartupHandler { // Start the emulation activity, send the ISO passed in and finish the main activity Intent emulation_intent = new Intent(parent, EmulationActivity.class); - emulation_intent.putExtra("SelectedGame", start_file); + emulation_intent.putExtra(EmulationActivity.EXTRA_SELECTED_GAMES, new String[]{start_file}); parent.startActivity(emulation_intent); parent.finish(); } From 3639607849a4035cf723054bb1a755678fda0f7b Mon Sep 17 00:00:00 2001 From: JosJuice Date: Mon, 28 Jan 2019 20:26:04 +0100 Subject: [PATCH 2/2] Android: Add an AutoStartFiles in addition to AutoStartFile Lets launchers specify multiple discs to launch, for automatic disc switching. --- .../dolphinemu/utils/StartupHandler.java | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/utils/StartupHandler.java b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/utils/StartupHandler.java index 2e473eb828..30253de9c8 100644 --- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/utils/StartupHandler.java +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/utils/StartupHandler.java @@ -26,18 +26,26 @@ public final class StartupHandler // Ask the user if he wants to enable analytics if we haven't yet. Analytics.checkAnalyticsInit(parent); - String start_file = ""; + String[] start_files = null; Bundle extras = parent.getIntent().getExtras(); if (extras != null) { - start_file = extras.getString("AutoStartFile"); + start_files = extras.getStringArray("AutoStartFiles"); + if (start_files == null) + { + String start_file = extras.getString("AutoStartFile"); + if (!TextUtils.isEmpty(start_file)) + { + start_files = new String[]{start_file}; + } + } } - if (!TextUtils.isEmpty(start_file)) + if (start_files != null && start_files.length > 0) { // Start the emulation activity, send the ISO passed in and finish the main activity Intent emulation_intent = new Intent(parent, EmulationActivity.class); - emulation_intent.putExtra(EmulationActivity.EXTRA_SELECTED_GAMES, new String[]{start_file}); + emulation_intent.putExtra(EmulationActivity.EXTRA_SELECTED_GAMES, start_files); parent.startActivity(emulation_intent); parent.finish(); }