From 5b677d93a14d41ff4ac76bf280b83ce4c68d972d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Mon, 21 Sep 2026 16:46:57 -0600 Subject: [PATCH] Android: Don't send the launch parameter to the native side twice On a cold start, onCreate passed the intent's shortcut parameter to NativeApp.init and then also posted it as a "shortcutParam" message, which is only meant for when the native side is already up. For a game shortcut the second boot request was rejected with an error. For the Args extra, the raw command line got booted as if it was a game path, so something like --loglevel=4 applied fine and then popped up a load failure. Co-Authored-By: Claude Fable 5.1 --- android/src/org/ppsspp/ppsspp/PpssppActivity.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/android/src/org/ppsspp/ppsspp/PpssppActivity.java b/android/src/org/ppsspp/ppsspp/PpssppActivity.java index 616c46ee77..c23dcc30f2 100644 --- a/android/src/org/ppsspp/ppsspp/PpssppActivity.java +++ b/android/src/org/ppsspp/ppsspp/PpssppActivity.java @@ -691,6 +691,8 @@ public class PpssppActivity extends AppCompatActivity implements SensorEventList // whether to start at 1x or 2x. sizeManager.updateDisplayMeasurements(); + // On the first run, the shortcut parameter is passed to NativeApp.init in here. + final boolean firstRun = !initialized; if (!initialized) { Initialize(); initialized = true; @@ -753,9 +755,9 @@ public class PpssppActivity extends AppCompatActivity implements SensorEventList // render loop thread will be started once we get a surface. } - if (shortcutParam != null && !shortcutParam.isEmpty()) { + if (!firstRun && shortcutParam != null && !shortcutParam.isEmpty()) { + // The native side is already up, so it didn't see this through NativeApp.init. Log.i(TAG, "Got shortcutParam in onCreate on secondary run: " + shortcutParam); - // Make sure we only send it once. NativeApp.sendMessageFromJava("shortcutParam", shortcutParam); }