Merge "Fix race condition in MetricsLoggerService" into nyc-dev am: be3e539ff7

am: 54b3111fca

* commit '54b3111fca3dbd1067a8256b11ed268431a9486d':
  Fix race condition in MetricsLoggerService

Change-Id: Ib79f15a534bcb53e2e4b737b23e56b20befad0f2
This commit is contained in:
Pavel Zhamaitsiak
2016-05-04 21:37:56 +00:00
committed by android-build-merger

View File

@@ -106,11 +106,13 @@ public class MetricsLoggerService extends SystemService {
}
private void resetThrottlingCounters(long currentTimeMillis) {
for (int i = 0; i < mThrottlingCounters.length; i++) {
mThrottlingCounters[i] = 0;
synchronized (mThrottlingCounters) {
for (int i = 0; i < mThrottlingCounters.length; i++) {
mThrottlingCounters[i] = 0;
}
mThrottlingIntervalBoundaryMillis =
currentTimeMillis + THROTTLING_TIME_INTERVAL_MILLIS;
}
mThrottlingIntervalBoundaryMillis =
currentTimeMillis + THROTTLING_TIME_INTERVAL_MILLIS;
}
private void addEvent(ConnectivityMetricsEvent e) {