From f706a6eaf94dcdb80a3320d1a4bfcedc2f8f50ad Mon Sep 17 00:00:00 2001 From: xshu Date: Mon, 25 Nov 2019 15:57:06 -0800 Subject: 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) --- service/java/com/android/server/wifi/WifiMetrics.java | 1 + 1 file changed, 1 insertion(+) (limited to 'service') 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 networks) { synchronized (mLock) { mWifiLogProto.numSavedNetworks = networks.size(); + mWifiLogProto.numSavedNetworksWithMacRandomization = 0; mWifiLogProto.numOpenNetworks = 0; mWifiLogProto.numLegacyPersonalNetworks = 0; mWifiLogProto.numLegacyEnterpriseNetworks = 0; -- cgit v1.2.3