Check for dead system

This commit is contained in:
M66B 2020-12-13 12:06:30 +01:00
parent c3933afd94
commit 47c070d543
1 changed files with 12 additions and 2 deletions

View File

@ -41,6 +41,7 @@ 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,7 +690,7 @@ public class Log {
// Some Android versions (Samsung) send images as clip data
return false;
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
/*
java.lang.RuntimeException: Failure from system
at android.app.ContextImpl.bindServiceCommon(ContextImpl.java:1327)
@ -706,7 +707,16 @@ public class Log {
*/
Throwable cause = ex;
while (cause != null) {
if (cause instanceof DeadObjectException) // Includes DeadSystemException
if (cause instanceof DeadObjectException)
return false;
cause = cause.getCause();
}
}
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
Throwable cause = ex;
while (cause != null) {
if (cause instanceof DeadSystemException)
return false;
cause = cause.getCause();
}