summaryrefslogtreecommitdiff
path: root/core/java
diff options
context:
space:
mode:
authorHugo Benichi <hugobenichi@google.com>2017-11-11 08:06:43 +0900
committerHugo Benichi <hugobenichi@google.com>2017-11-13 14:15:51 +0900
commit97bfd276fb008a66b76b6f72a64db1eca2ab477c (patch)
tree38f78cc4efde928ae5cabe5bcc80aaf82c94ee43 /core/java
parent6ee20ca7d380b1d59cf24898ba83a9c4cb57849c (diff)
IP connectivity metrics: NetworkEvents have transports
Also removes netId field from inside NetworkEvent and stop populating the network_id field of the NetworkEvent field, deprecating it. Bug: 34901696 Test: runtest frameworks-net, manually looking at $ adb shell dumpsys connmetrics Change-Id: I2c36860f976898883714f72f4d18e06da250c6a6
Diffstat (limited to 'core/java')
-rw-r--r--core/java/android/net/metrics/NetworkEvent.java14
1 files changed, 5 insertions, 9 deletions
diff --git a/core/java/android/net/metrics/NetworkEvent.java b/core/java/android/net/metrics/NetworkEvent.java
index 4df3bf095056..1999e78decc4 100644
--- a/core/java/android/net/metrics/NetworkEvent.java
+++ b/core/java/android/net/metrics/NetworkEvent.java
@@ -60,29 +60,25 @@ public final class NetworkEvent implements Parcelable {
@Retention(RetentionPolicy.SOURCE)
public @interface EventType {}
- public final int netId;
public final @EventType int eventType;
public final long durationMs;
- public NetworkEvent(int netId, @EventType int eventType, long durationMs) {
- this.netId = netId;
+ public NetworkEvent(@EventType int eventType, long durationMs) {
this.eventType = eventType;
this.durationMs = durationMs;
}
- public NetworkEvent(int netId, @EventType int eventType) {
- this(netId, eventType, 0);
+ public NetworkEvent(@EventType int eventType) {
+ this(eventType, 0);
}
private NetworkEvent(Parcel in) {
- netId = in.readInt();
eventType = in.readInt();
durationMs = in.readLong();
}
@Override
public void writeToParcel(Parcel out, int flags) {
- out.writeInt(netId);
out.writeInt(eventType);
out.writeLong(durationMs);
}
@@ -105,8 +101,8 @@ public final class NetworkEvent implements Parcelable {
@Override
public String toString() {
- return String.format("NetworkEvent(%d, %s, %dms)",
- netId, Decoder.constants.get(eventType), durationMs);
+ return String.format("NetworkEvent(%s, %dms)",
+ Decoder.constants.get(eventType), durationMs);
}
final static class Decoder {