mirror of https://github.com/M66B/FairEmail.git
Filter DeadObjectException
This commit is contained in:
parent
3800c98239
commit
182c667d36
|
@ -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()) &&
|
||||
|
|
Loading…
Reference in New Issue