am bc03c74c: am d968670d: Merge "Conservatively trim data usage stats." into ics-mr1
* commit 'bc03c74c485669695805944a655795a6f9890956': Conservatively trim data usage stats.
This commit is contained in:
@@ -1243,7 +1243,8 @@ public class NetworkStatsService extends INetworkStatsService.Stub {
|
|||||||
|
|
||||||
// trim any history beyond max
|
// trim any history beyond max
|
||||||
if (mTime.hasCache()) {
|
if (mTime.hasCache()) {
|
||||||
final long currentTime = mTime.currentTimeMillis();
|
final long currentTime = Math.min(
|
||||||
|
System.currentTimeMillis(), mTime.currentTimeMillis());
|
||||||
final long maxHistory = mSettings.getNetworkMaxHistory();
|
final long maxHistory = mSettings.getNetworkMaxHistory();
|
||||||
for (NetworkStatsHistory history : input.values()) {
|
for (NetworkStatsHistory history : input.values()) {
|
||||||
history.removeBucketsBefore(currentTime - maxHistory);
|
history.removeBucketsBefore(currentTime - maxHistory);
|
||||||
@@ -1287,7 +1288,8 @@ public class NetworkStatsService extends INetworkStatsService.Stub {
|
|||||||
|
|
||||||
// trim any history beyond max
|
// trim any history beyond max
|
||||||
if (mTime.hasCache()) {
|
if (mTime.hasCache()) {
|
||||||
final long currentTime = mTime.currentTimeMillis();
|
final long currentTime = Math.min(
|
||||||
|
System.currentTimeMillis(), mTime.currentTimeMillis());
|
||||||
final long maxUidHistory = mSettings.getUidMaxHistory();
|
final long maxUidHistory = mSettings.getUidMaxHistory();
|
||||||
final long maxTagHistory = mSettings.getTagMaxHistory();
|
final long maxTagHistory = mSettings.getTagMaxHistory();
|
||||||
for (UidStatsKey key : mUidStats.keySet()) {
|
for (UidStatsKey key : mUidStats.keySet()) {
|
||||||
|
|||||||
Reference in New Issue
Block a user