summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--service/java/com/android/server/wifi/WifiMetrics.java8
1 files changed, 5 insertions, 3 deletions
diff --git a/service/java/com/android/server/wifi/WifiMetrics.java b/service/java/com/android/server/wifi/WifiMetrics.java
index 2e9e34c07..7578d3723 100644
--- a/service/java/com/android/server/wifi/WifiMetrics.java
+++ b/service/java/com/android/server/wifi/WifiMetrics.java
@@ -3791,9 +3791,11 @@ public class WifiMetrics {
mLastScore = -1;
mLastWifiUsabilityScore = -1;
mLastPredictionHorizonSec = -1;
- mStaEventList.add(new StaEventWithTime(staEvent, mClock.getWallClockMillis()));
- // Prune StaEventList if it gets too long
- if (mStaEventList.size() > MAX_STA_EVENTS) mStaEventList.remove();
+ synchronized (mLock) {
+ mStaEventList.add(new StaEventWithTime(staEvent, mClock.getWallClockMillis()));
+ // Prune StaEventList if it gets too long
+ if (mStaEventList.size() > MAX_STA_EVENTS) mStaEventList.remove();
+ }
}
private ConfigInfo createConfigInfo(WifiConfiguration config) {