mirror of
https://github.com/izzy2lost/dolphin.git
synced 2026-06-19 01:16:48 -07:00
Android: Finish EmulationActivity from C++
This makes EmulationActivity automatically close if booting fails, and lets us get rid of s_emulation_end_event.
This commit is contained in:
@@ -563,6 +563,20 @@ public final class NativeLibrary
|
||||
sEmulationActivity.clear();
|
||||
}
|
||||
|
||||
public static void finishEmulationActivity()
|
||||
{
|
||||
final EmulationActivity emulationActivity = sEmulationActivity.get();
|
||||
if (emulationActivity == null)
|
||||
{
|
||||
Log.warning("[NativeLibrary] EmulationActivity is null.");
|
||||
}
|
||||
else
|
||||
{
|
||||
Log.verbose("[NativeLibrary] Finishing EmulationActivity.");
|
||||
emulationActivity.runOnUiThread(emulationActivity::finish);
|
||||
}
|
||||
}
|
||||
|
||||
public static void updateTouchPointer()
|
||||
{
|
||||
final EmulationActivity emulationActivity = sEmulationActivity.get();
|
||||
|
||||
-2
@@ -342,7 +342,6 @@ public final class EmulationActivity extends AppCompatActivity
|
||||
if (keyCode == KeyEvent.KEYCODE_BACK)
|
||||
{
|
||||
mEmulationFragment.stopEmulation();
|
||||
finish();
|
||||
return true;
|
||||
}
|
||||
return super.onKeyLongPress(keyCode, event);
|
||||
@@ -617,7 +616,6 @@ public final class EmulationActivity extends AppCompatActivity
|
||||
|
||||
case MENU_ACTION_EXIT:
|
||||
mEmulationFragment.stopEmulation();
|
||||
finish();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user