From 182c667d3666022b21d4cf4a7e6ea4ab9d0dbf8f Mon Sep 17 00:00:00 2001 From: M66B Date: Sun, 25 Oct 2020 14:59:49 +0100 Subject: [PATCH] Filter DeadObjectException --- app/src/main/java/eu/faircode/email/Log.java | 39 ++++++++------------ 1 file changed, 15 insertions(+), 24 deletions(-) diff --git a/app/src/main/java/eu/faircode/email/Log.java b/app/src/main/java/eu/faircode/email/Log.java index 67cf2fab67..d360b5c978 100644 --- a/app/src/main/java/eu/faircode/email/Log.java +++ b/app/src/main/java/eu/faircode/email/Log.java @@ -40,7 +40,6 @@ import android.os.BadParcelableException; import android.os.Build; import android.os.Bundle; import android.os.DeadObjectException; -import android.os.DeadSystemException; import android.os.Debug; import android.os.PowerManager; import android.os.RemoteException; @@ -689,9 +688,23 @@ public class Log { return false; if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) { + /* + java.lang.RuntimeException: Failure from system + at android.app.ContextImpl.bindServiceCommon(ContextImpl.java:1327) + at android.app.ContextImpl.bindService(ContextImpl.java:1286) + at android.content.ContextWrapper.bindService(ContextWrapper.java:604) + at android.content.ContextWrapper.bindService(ContextWrapper.java:604) + at hq.run(PG:15) + at java.lang.Thread.run(Thread.java:818) + Caused by: android.os.DeadObjectException + at android.os.BinderProxy.transactNative(Native Method) + at android.os.BinderProxy.transact(Binder.java:503) + at android.app.ActivityManagerProxy.bindService(ActivityManagerNative.java:3783) + at android.app.ContextImpl.bindServiceCommon(ContextImpl.java:1317) + */ Throwable cause = ex; while (cause != null) { - if (cause instanceof DeadSystemException) + if (cause instanceof DeadObjectException) // Includes DeadSystemException return false; cause = cause.getCause(); } @@ -770,24 +783,6 @@ public class Log { at android.app.ActivityThread.main(ActivityThread.java:7397) */ - if (ex instanceof RuntimeException && - "Failure from system".equals(ex.getMessage())) - /* - java.lang.RuntimeException: Failure from system - at android.app.ContextImpl.bindServiceCommon(ContextImpl.java:1327) - at android.app.ContextImpl.bindService(ContextImpl.java:1286) - at android.content.ContextWrapper.bindService(ContextWrapper.java:604) - at android.content.ContextWrapper.bindService(ContextWrapper.java:604) - at hq.run(PG:15) - at java.lang.Thread.run(Thread.java:818) - Caused by: android.os.DeadObjectException - at android.os.BinderProxy.transactNative(Native Method) - at android.os.BinderProxy.transact(Binder.java:503) - at android.app.ActivityManagerProxy.bindService(ActivityManagerNative.java:3783) - at android.app.ContextImpl.bindServiceCommon(ContextImpl.java:1317) - */ - return false; - if (ex.getMessage() != null && (ex.getMessage().startsWith("Bad notification posted") || ex.getMessage().contains("ActivityRecord not found") || @@ -852,10 +847,6 @@ public class Log { */ return false; - if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) - if (ex instanceof RuntimeException && ex.getCause() instanceof DeadObjectException) - return false; - StackTraceElement[] stack = ex.getStackTrace(); if (stack.length > 0 && "android.text.TextLine".equals(stack[0].getClassName()) &&