From bc08d071ba55d98b1ad2523b3acf9dabaa188d95 Mon Sep 17 00:00:00 2001 From: Jeff Sharkey Date: Fri, 26 Feb 2016 13:03:01 -0700 Subject: [PATCH] When system server goes down, crash apps more. Similar to first patch, but now using new "rethrowFromSystemServer()" method which internally translates DeadObjectException into DeadSystemException. New logic over in Log.printlns() now suppresses the DeadSystemException stack traces, since they're misleading and just added pressure to the precious log buffer space. Add some extra RuntimeInit checks to suppress logging-about-logging when the system server is dead. Bug: 27364859 Change-Id: I05316b3e8e42416b30a56a76c09cd3113a018123 --- core/java/android/net/TrafficStats.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/core/java/android/net/TrafficStats.java b/core/java/android/net/TrafficStats.java index e82485da32..ba8bd34bfc 100644 --- a/core/java/android/net/TrafficStats.java +++ b/core/java/android/net/TrafficStats.java @@ -310,7 +310,7 @@ public class TrafficStats { try { getStatsService().incrementOperationCount(uid, tag, operationCount); } catch (RemoteException e) { - throw new RuntimeException(e); + throw e.rethrowFromSystemServer(); } } @@ -653,7 +653,7 @@ public class TrafficStats { try { return getStatsService().getDataLayerSnapshotForUid(uid); } catch (RemoteException e) { - throw new RuntimeException(e); + throw e.rethrowFromSystemServer(); } } @@ -666,7 +666,7 @@ public class TrafficStats { try { return getStatsService().getMobileIfaces(); } catch (RemoteException e) { - throw new RuntimeException(e); + throw e.rethrowFromSystemServer(); } }