mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-01-26 12:35:27 +00:00
Android: Fix race condition with writing files before setting User path
This commit is contained in:
parent
3262314435
commit
152f7fa35c
@ -13,33 +13,31 @@ public final class StartupHandler
|
||||
{
|
||||
public static boolean HandleInit(FragmentActivity parent)
|
||||
{
|
||||
NativeLibrary.SetUserDirectory(""); // Auto-Detect
|
||||
|
||||
if (PermissionsHandler.checkWritePermission(parent)) {
|
||||
DirectoryInitializationService.startService(parent);
|
||||
}
|
||||
|
||||
Intent intent = parent.getIntent();
|
||||
Bundle extras = intent.getExtras();
|
||||
String user_dir = "";
|
||||
String start_file = "";
|
||||
|
||||
Bundle extras = parent.getIntent().getExtras();
|
||||
if (extras != null)
|
||||
{
|
||||
String user_dir = extras.getString("UserDir");
|
||||
String start_file = extras.getString("AutoStartFile");
|
||||
|
||||
if (!TextUtils.isEmpty(user_dir))
|
||||
NativeLibrary.SetUserDirectory(user_dir);
|
||||
|
||||
if (!TextUtils.isEmpty(start_file))
|
||||
{
|
||||
// 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);
|
||||
parent.startActivity(emulation_intent);
|
||||
parent.finish();
|
||||
return false;
|
||||
}
|
||||
user_dir = extras.getString("UserDir");
|
||||
start_file = extras.getString("AutoStartFile");
|
||||
}
|
||||
|
||||
NativeLibrary.SetUserDirectory(user_dir); // Uses default path if user_dir equals ""
|
||||
|
||||
if (PermissionsHandler.checkWritePermission(parent))
|
||||
DirectoryInitializationService.startService(parent);
|
||||
|
||||
if (!TextUtils.isEmpty(start_file))
|
||||
{
|
||||
// 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);
|
||||
parent.startActivity(emulation_intent);
|
||||
parent.finish();
|
||||
return false;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user