diff options
| author | 2018-07-05 05:25:35 -0700 | |
|---|---|---|
| committer | 2018-07-05 05:25:35 -0700 | |
| commit | 9ca5d6f0a01ddeb8f682293558bfbd8a37341ff6 (patch) | |
| tree | 6a319a706847ba2a3c4f9997e02dcdf913b695a7 | |
| parent | 2fd79e4f049452040aacd8da52b59d226d364557 (diff) | |
| parent | 67dcf6da3cb9d405117ef27e7362ef73cecbb123 (diff) | |
Merge "Track constructor changes in libcore/" am: f94eb29500
am: 67dcf6da3c
Change-Id: I1205219e1fead95ecdb8f9ce5d503ec416baf4c2
| -rw-r--r-- | core/java/com/android/internal/net/NetworkStatsFactory.java | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/core/java/com/android/internal/net/NetworkStatsFactory.java b/core/java/com/android/internal/net/NetworkStatsFactory.java index c4d08c7dc5d6..d1c279918bb4 100644 --- a/core/java/com/android/internal/net/NetworkStatsFactory.java +++ b/core/java/com/android/internal/net/NetworkStatsFactory.java @@ -194,7 +194,7 @@ public class NetworkStatsFactory { reader.finishLine(); } } catch (NullPointerException|NumberFormatException e) { - throw new ProtocolException("problem parsing stats", e); + throw protocolExceptionWithCause("problem parsing stats", e); } finally { IoUtils.closeQuietly(reader); StrictMode.setThreadPolicy(savedPolicy); @@ -244,7 +244,7 @@ public class NetworkStatsFactory { reader.finishLine(); } } catch (NullPointerException|NumberFormatException e) { - throw new ProtocolException("problem parsing stats", e); + throw protocolExceptionWithCause("problem parsing stats", e); } finally { IoUtils.closeQuietly(reader); StrictMode.setThreadPolicy(savedPolicy); @@ -341,7 +341,7 @@ public class NetworkStatsFactory { reader.finishLine(); } } catch (NullPointerException|NumberFormatException e) { - throw new ProtocolException("problem parsing idx " + idx, e); + throw protocolExceptionWithCause("problem parsing idx " + idx, e); } finally { IoUtils.closeQuietly(reader); StrictMode.setThreadPolicy(savedPolicy); @@ -378,4 +378,10 @@ public class NetworkStatsFactory { @VisibleForTesting public static native int nativeReadNetworkStatsDev(NetworkStats stats); + + private static ProtocolException protocolExceptionWithCause(String message, Throwable cause) { + ProtocolException pe = new ProtocolException(message); + pe.initCause(cause); + return pe; + } } |