Run emulation in a separate process

Exiting from emulation has always been a big issue for Skyline, with guest and host threads that would keep running in the background unless the app was manually killed. Running emulation in a separate process allows us to kill it when we are done, avoiding the need for complex exiting management code.
This commit is contained in:
lynxnb 2022-10-21 12:41:36 +02:00 committed by Billy Laws
parent 281562ccdb
commit cc71e7b56c
2 changed files with 2 additions and 1 deletions

View File

@ -68,6 +68,7 @@
android:configChanges="orientation|screenSize|uiMode"
android:exported="true"
android:launchMode="singleTask"
android:process=":emulationProcess"
android:parentActivityName=".MainActivity">
<intent-filter>

View File

@ -219,7 +219,7 @@ class EmulationActivity : AppCompatActivity(), SurfaceHolder.Callback, View.OnTo
shouldFinish = false
if (returnToMain)
startActivity(Intent(applicationContext, MainActivity::class.java).setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP))
finishAffinity()
Process.killProcess(Process.myPid())
}
}
}