diff options
author | Mingguang Xu <mingguangxu@google.com> | 2019-10-23 22:46:12 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2019-10-23 22:46:12 +0000 |
commit | 1c37a9bce91dcf7d522a713cb05bc0dd9777aab7 (patch) | |
tree | 1c93e6c7bb7c353aee219018cc216fafdbbd65e5 | |
parent | 2b675f5fc532687617bd8d29474657cab35285a0 (diff) | |
parent | 12bcb71c4267d7c380c02594571f4eff99613836 (diff) |
Merge "Wifi usability: Clear the ring buffer after adding each usability stats to the upload list."
-rw-r--r-- | service/java/com/android/server/wifi/WifiMetrics.java | 1 | ||||
-rw-r--r-- | tests/wifitests/src/com/android/server/wifi/WifiMetricsTest.java | 5 |
2 files changed, 4 insertions, 2 deletions
diff --git a/service/java/com/android/server/wifi/WifiMetrics.java b/service/java/com/android/server/wifi/WifiMetrics.java index e178e727b..a875cd6c3 100644 --- a/service/java/com/android/server/wifi/WifiMetrics.java +++ b/service/java/com/android/server/wifi/WifiMetrics.java @@ -4532,6 +4532,7 @@ public class WifiMetrics { } } mWifiUsabilityStatsCounter = 0; + mWifiUsabilityStatsEntriesList.clear(); } } diff --git a/tests/wifitests/src/com/android/server/wifi/WifiMetricsTest.java b/tests/wifitests/src/com/android/server/wifi/WifiMetricsTest.java index f0defde0c..b3f1ed12e 100644 --- a/tests/wifitests/src/com/android/server/wifi/WifiMetricsTest.java +++ b/tests/wifitests/src/com/android/server/wifi/WifiMetricsTest.java @@ -2967,9 +2967,10 @@ public class WifiMetricsTest extends WifiBaseTest { dumpProtoAndDeserialize(); assertEquals(2 * WifiMetrics.MAX_WIFI_USABILITY_STATS_PER_TYPE_TO_UPLOAD, mDecodedProto.wifiUsabilityStatsList.length); - for (int i = 0; i < mDecodedProto.wifiUsabilityStatsList.length; i++) { + for (int i = 0; i < WifiMetrics.MAX_WIFI_USABILITY_STATS_PER_TYPE_TO_UPLOAD; i++) { assertEquals(WifiMetrics.MAX_WIFI_USABILITY_STATS_ENTRIES_LIST_SIZE, - mDecodedProto.wifiUsabilityStatsList[i].stats.length); + mDecodedProto.wifiUsabilityStatsList[2 * i].stats.length); + assertEquals(2, mDecodedProto.wifiUsabilityStatsList[2 * i + 1].stats.length); } } |