Make operation counts monotonically increase.
Bug: 5585704 Change-Id: I5247a68acdb209a4ef0f5aac18944595c295e6ca
This commit is contained in:
@@ -165,6 +165,17 @@ public class NetworkStats implements Parcelable {
|
||||
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
|
||||
public NetworkStats addIfaceValues(
|
||||
String iface, long rxBytes, long rxPackets, long txBytes, long txPackets) {
|
||||
|
||||
@@ -971,8 +971,7 @@ public class NetworkStatsService extends INetworkStatsService.Stub {
|
||||
}
|
||||
|
||||
mLastPollUidSnapshot = uidSnapshot;
|
||||
mLastPollOperationsSnapshot = mOperations;
|
||||
mOperations = new NetworkStats(0L, 10);
|
||||
mLastPollOperationsSnapshot = mOperations.clone();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user