summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorxshu <xshu@google.com>2019-11-25 15:57:06 -0800
committerOscar Shu <xshu@google.com>2019-12-03 01:02:21 +0000
commitf706a6eaf94dcdb80a3320d1a4bfcedc2f8f50ad (patch)
tree18bc68be17cf239fe71c81263ff432b492406e1e
parentf294fbb8b6271d54a73bfe627503c92cc8974a85 (diff)
Reset num saved networks with mac randomization before counting
Even though this is already being reset after metrics upload, data suggests that this is still getting double counted in some cases. Clear the counter before looping through networks to make sure the state is clean. Bug: 145163801 Test: unit tests Change-Id: Iaa1f5625458068f007313e58bb5a443a63810be8 Merged-In: Iaa1f5625458068f007313e58bb5a443a63810be8 (cherry picked from commit 5e381e8f1c1e14eefadff142a311ce6c4fc2b6dd)
-rw-r--r--service/java/com/android/server/wifi/WifiMetrics.java1
1 files changed, 1 insertions, 0 deletions
diff --git a/service/java/com/android/server/wifi/WifiMetrics.java b/service/java/com/android/server/wifi/WifiMetrics.java
index 27fe140a7..2e9e34c07 100644
--- a/service/java/com/android/server/wifi/WifiMetrics.java
+++ b/service/java/com/android/server/wifi/WifiMetrics.java
@@ -2942,6 +2942,7 @@ public class WifiMetrics {
public void updateSavedNetworks(List<WifiConfiguration> networks) {
synchronized (mLock) {
mWifiLogProto.numSavedNetworks = networks.size();
+ mWifiLogProto.numSavedNetworksWithMacRandomization = 0;
mWifiLogProto.numOpenNetworks = 0;
mWifiLogProto.numLegacyPersonalNetworks = 0;
mWifiLogProto.numLegacyEnterpriseNetworks = 0;