| 1506 | } |
| 1507 | |
| 1508 | private static boolean isDead(Throwable ex) { |
| 1509 | if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { |
| 1510 | /* |
| 1511 | java.lang.RuntimeException: Failure from system |
| 1512 | at android.app.ContextImpl.bindServiceCommon(ContextImpl.java:1327) |
| 1513 | at android.app.ContextImpl.bindService(ContextImpl.java:1286) |
| 1514 | at android.content.ContextWrapper.bindService(ContextWrapper.java:604) |
| 1515 | at android.content.ContextWrapper.bindService(ContextWrapper.java:604) |
| 1516 | at hq.run(PG:15) |
| 1517 | at java.lang.Thread.run(Thread.java:818) |
| 1518 | Caused by: android.os.DeadObjectException |
| 1519 | at android.os.BinderProxy.transactNative(Native Method) |
| 1520 | at android.os.BinderProxy.transact(Binder.java:503) |
| 1521 | at android.app.ActivityManagerProxy.bindService(ActivityManagerNative.java:3783) |
| 1522 | at android.app.ContextImpl.bindServiceCommon(ContextImpl.java:1317) |
| 1523 | */ |
| 1524 | Throwable cause = ex; |
| 1525 | while (cause != null) { |
| 1526 | if (cause instanceof DeadObjectException) |
| 1527 | return true; |
| 1528 | cause = cause.getCause(); |
| 1529 | } |
| 1530 | } |
| 1531 | |
| 1532 | if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) { |
| 1533 | Throwable cause = ex; |
| 1534 | while (cause != null) { |
| 1535 | if (cause instanceof DeadSystemException) |
| 1536 | return true; |
| 1537 | cause = cause.getCause(); |
| 1538 | } |
| 1539 | } |
| 1540 | |
| 1541 | return false; |
| 1542 | } |
| 1543 | |
| 1544 | static String formatThrowable(Throwable ex) { |
| 1545 | return formatThrowable(ex, true); |