mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-10-14 15:00:30 +02:00
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 <noreply@anthropic.com>
This commit is contained in:
1 parent
3cb6ada66a
commit
5b677d93a1
1 file changed
+4
-2
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user