api-impl: android/os/Process: handle self-kill

We don't currently implement sendSignal, however Unity uses killProcess to kill
its own process, which we can hadle with simple System.exit(0) and have Unity
games close cleanly
This commit is contained in:
Mis012
2024-03-01 15:38:42 +01:00
parent 60714ebf45
commit a9c72d58fd

View File

@@ -676,6 +676,11 @@ public class Process {
* other's processes.
*/
public static final void killProcess(int pid) {
if(pid == Process.myPid()) {
System.out.println("the app called killProcess on itself");
System.exit(0);
}
sendSignal(pid, SIGNAL_KILL);
}