Merge pull request #8860 from Ebola16/Emu
Android: Disallow multiple launcher activities
This commit is contained in:
commit
a2b7627d66
|
@ -73,6 +73,7 @@ public final class EmulationActivity extends AppCompatActivity
|
||||||
private boolean mDeviceHasTouchScreen;
|
private boolean mDeviceHasTouchScreen;
|
||||||
private boolean mMenuVisible;
|
private boolean mMenuVisible;
|
||||||
|
|
||||||
|
private static boolean sIgnoreLaunchRequests = false;
|
||||||
private static boolean sIsGameCubeGame;
|
private static boolean sIsGameCubeGame;
|
||||||
|
|
||||||
private boolean activityRecreated;
|
private boolean activityRecreated;
|
||||||
|
@ -196,6 +197,11 @@ public final class EmulationActivity extends AppCompatActivity
|
||||||
|
|
||||||
public static void launch(FragmentActivity activity, GameFile gameFile)
|
public static void launch(FragmentActivity activity, GameFile gameFile)
|
||||||
{
|
{
|
||||||
|
if (sIgnoreLaunchRequests)
|
||||||
|
return;
|
||||||
|
|
||||||
|
sIgnoreLaunchRequests = true;
|
||||||
|
|
||||||
Intent launcher = new Intent(activity, EmulationActivity.class);
|
Intent launcher = new Intent(activity, EmulationActivity.class);
|
||||||
|
|
||||||
launcher.putExtra(EXTRA_SELECTED_GAMES, scanForSecondDisc(gameFile));
|
launcher.putExtra(EXTRA_SELECTED_GAMES, scanForSecondDisc(gameFile));
|
||||||
|
@ -207,6 +213,11 @@ public final class EmulationActivity extends AppCompatActivity
|
||||||
|
|
||||||
public static void launchFile(FragmentActivity activity, String[] filePaths)
|
public static void launchFile(FragmentActivity activity, String[] filePaths)
|
||||||
{
|
{
|
||||||
|
if (sIgnoreLaunchRequests)
|
||||||
|
return;
|
||||||
|
|
||||||
|
sIgnoreLaunchRequests = true;
|
||||||
|
|
||||||
Intent launcher = new Intent(activity, EmulationActivity.class);
|
Intent launcher = new Intent(activity, EmulationActivity.class);
|
||||||
launcher.putExtra(EXTRA_SELECTED_GAMES, filePaths);
|
launcher.putExtra(EXTRA_SELECTED_GAMES, filePaths);
|
||||||
|
|
||||||
|
@ -237,6 +248,11 @@ public final class EmulationActivity extends AppCompatActivity
|
||||||
activity.startActivity(launcher);
|
activity.startActivity(launcher);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void stopIgnoringLaunchRequests()
|
||||||
|
{
|
||||||
|
sIgnoreLaunchRequests = false;
|
||||||
|
}
|
||||||
|
|
||||||
public static void clearWiimoteNewIniLinkedPreferences(Context context)
|
public static void clearWiimoteNewIniLinkedPreferences(Context context)
|
||||||
{
|
{
|
||||||
SharedPreferences.Editor editor = PreferenceManager.getDefaultSharedPreferences(context).edit();
|
SharedPreferences.Editor editor = PreferenceManager.getDefaultSharedPreferences(context).edit();
|
||||||
|
|
|
@ -411,6 +411,7 @@ public final class EmulationFragment extends Fragment implements SurfaceHolder.C
|
||||||
Log.debug("[EmulationFragment] Starting emulation thread.");
|
Log.debug("[EmulationFragment] Starting emulation thread.");
|
||||||
NativeLibrary.Run(mGamePaths);
|
NativeLibrary.Run(mGamePaths);
|
||||||
}
|
}
|
||||||
|
EmulationActivity.stopIgnoringLaunchRequests();
|
||||||
}, "NativeEmulation");
|
}, "NativeEmulation");
|
||||||
emulationThread.start();
|
emulationThread.start();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue