summaryrefslogtreecommitdiff
path: root/core/java
diff options
context:
space:
mode:
authorNeil Fuller <nfuller@google.com>2018-07-05 05:14:26 -0700
committerandroid-build-merger <android-build-merger@google.com>2018-07-05 05:14:26 -0700
commit67dcf6da3cb9d405117ef27e7362ef73cecbb123 (patch)
tree7d0ee1b385665d1d96c136dad0a9a106435a75bb /core/java
parent08923b73f4b4117624bfabab0389bcf8dc30ddec (diff)
parentf94eb2950090786d98efcaaf07c9ff687f853868 (diff)
Merge "Track constructor changes in libcore/"
am: f94eb29500 Change-Id: I344d9210bd173f78651318366c852f65afe969d6
Diffstat (limited to 'core/java')
-rw-r--r--core/java/com/android/internal/net/NetworkStatsFactory.java12
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;
+ }
}