summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Neil Fuller <nfuller@google.com> 2018-07-03 19:22:45 +0100
committer Neil Fuller <nfuller@google.com> 2018-07-03 19:22:45 +0100
commit038b20c99b6a70e28cea0a63532ebf092c5321fb (patch)
treefc739b61819463e3f40aab3789f76b5856a4517e
parent9916d4b3e89b1faf8b658cc3924e0b30cc46958a (diff)
Track constructor changes in libcore/
The 2-arg constructor is being removed. Test: build / boot Bug: 111055375 Change-Id: I72413a8c7885f9514a88f59deb649fa755deff92
-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 41802cc60617..fb54e6940056 100644
--- a/core/java/com/android/internal/net/NetworkStatsFactory.java
+++ b/core/java/com/android/internal/net/NetworkStatsFactory.java
@@ -192,7 +192,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);
@@ -242,7 +242,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);
@@ -339,7 +339,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);
@@ -376,4 +376,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;
+ }
}