Kill crash reporter process only with some delay

This commit is contained in:
Torsten Grote
2020-12-14 09:14:42 -03:00
parent ac4fbf202f
commit 97118fd92b

View File

@@ -2,6 +2,8 @@ package org.briarproject.briar.android.reporting;
import android.content.Intent; import android.content.Intent;
import android.os.Bundle; import android.os.Bundle;
import android.os.Handler;
import android.os.Looper;
import android.os.Process; import android.os.Process;
import android.widget.Toast; import android.widget.Toast;
@@ -104,8 +106,10 @@ public class CrashReportActivity extends BaseActivity
startActivity(i); startActivity(i);
// crash reports run in their own process that we should kill now // crash reports run in their own process that we should kill now
// otherwise it keeps running and e.g. doesn't pick up theme changes // otherwise it keeps running and e.g. doesn't pick up theme changes
Process.killProcess(Process.myPid()); new Handler(Looper.getMainLooper()).postDelayed(() -> {
System.exit(10); Process.killProcess(Process.myPid());
// kill the process with some delay to keep the Toast visible
}, 5000);
} }
finish(); finish();
} }