am 489b4312: am 4c48d2ff: Merge "Make operation counts monotonically increase." into ics-mr1
* commit '489b431273500db81d35ed43440915187c238f92': Make operation counts monotonically increase.
This commit is contained in:
@@ -165,6 +165,17 @@ public class NetworkStats implements Parcelable {
|
|||||||
dest.writeLongArray(operations);
|
dest.writeLongArray(operations);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public NetworkStats clone() {
|
||||||
|
final NetworkStats clone = new NetworkStats(elapsedRealtime, size);
|
||||||
|
NetworkStats.Entry entry = null;
|
||||||
|
for (int i = 0; i < size; i++) {
|
||||||
|
entry = getValues(i, entry);
|
||||||
|
clone.addValues(entry);
|
||||||
|
}
|
||||||
|
return clone;
|
||||||
|
}
|
||||||
|
|
||||||
// @VisibleForTesting
|
// @VisibleForTesting
|
||||||
public NetworkStats addIfaceValues(
|
public NetworkStats addIfaceValues(
|
||||||
String iface, long rxBytes, long rxPackets, long txBytes, long txPackets) {
|
String iface, long rxBytes, long rxPackets, long txBytes, long txPackets) {
|
||||||
|
|||||||
@@ -971,8 +971,7 @@ public class NetworkStatsService extends INetworkStatsService.Stub {
|
|||||||
}
|
}
|
||||||
|
|
||||||
mLastPollUidSnapshot = uidSnapshot;
|
mLastPollUidSnapshot = uidSnapshot;
|
||||||
mLastPollOperationsSnapshot = mOperations;
|
mLastPollOperationsSnapshot = mOperations.clone();
|
||||||
mOperations = new NetworkStats(0L, 10);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user