Merge "Fix race condition in MetricsLoggerService" into nyc-dev

This commit is contained in:
Pavel Zhamaitsiak
2016-05-04 17:02:16 +00:00
committed by Android (Google) Code Review

View File

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