Ignore dead system exception

This commit is contained in:
M66B 2018-10-15 06:02:56 +00:00
parent e285cde0b3
commit b50877bfd1
1 changed files with 6 additions and 0 deletions

View File

@ -23,6 +23,8 @@ import android.app.Application;
import android.app.Notification;
import android.app.NotificationChannel;
import android.app.NotificationManager;
import android.os.Build;
import android.os.DeadSystemException;
import android.os.RemoteException;
import android.util.Log;
@ -95,6 +97,10 @@ public class ApplicationEx extends Application {
if (ex instanceof RemoteException)
return false;
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N)
if (ex instanceof RuntimeException && ex.getCause() instanceof DeadSystemException)
return false;
while (ex != null) {
for (StackTraceElement ste : ex.getStackTrace())
if (ste.getClassName().startsWith(getPackageName()))