From d9c0f4c52fbb2a0b0824688a8461a60874a675c2 Mon Sep 17 00:00:00 2001 From: Mingguang Xu Date: Fri, 19 Apr 2019 14:06:38 -0700 Subject: Wifi usability: Add timestamp in WifiUsabilityStats Together with the timestamps in each entry (WifiUsabilityStatsEntry) of WifiUsabilityStats, the added timestamp allows us to check whether the WifiUsabilityStats is obsolete or not. Bug: 129282057 Test: frameworks/opt/net/wifi/tests/wifitests/runtests.sh Change-Id: If7ffcbc028eab747c4f632da2c438a773cad938d Signed-off-by: Mingguang Xu --- service/java/com/android/server/wifi/WifiMetrics.java | 3 +++ 1 file changed, 3 insertions(+) (limited to 'service') diff --git a/service/java/com/android/server/wifi/WifiMetrics.java b/service/java/com/android/server/wifi/WifiMetrics.java index 125cd0987..b10e66edf 100644 --- a/service/java/com/android/server/wifi/WifiMetrics.java +++ b/service/java/com/android/server/wifi/WifiMetrics.java @@ -2712,6 +2712,7 @@ public class WifiMetrics { for (WifiUsabilityStats stats : mWifiUsabilityStatsListGood) { pw.println("\nlabel=" + stats.label); pw.println("\ntrigger_type=" + stats.triggerType); + pw.println("\ntime_stamp_ms=" + stats.timeStampMs); for (WifiUsabilityStatsEntry entry : stats.stats) { printWifiUsabilityStatsEntry(pw, entry); } @@ -2719,6 +2720,7 @@ public class WifiMetrics { for (WifiUsabilityStats stats : mWifiUsabilityStatsListBad) { pw.println("\nlabel=" + stats.label); pw.println("\ntrigger_type=" + stats.triggerType); + pw.println("\ntime_stamp_ms=" + stats.timeStampMs); for (WifiUsabilityStatsEntry entry : stats.stats) { printWifiUsabilityStatsEntry(pw, entry); } @@ -4444,6 +4446,7 @@ public class WifiMetrics { wifiUsabilityStats.label = label; wifiUsabilityStats.triggerType = triggerType; wifiUsabilityStats.firmwareAlertCode = firmwareAlertCode; + wifiUsabilityStats.timeStampMs = mClock.getElapsedSinceBootMillis(); wifiUsabilityStats.stats = new WifiUsabilityStatsEntry[mWifiUsabilityStatsEntriesList.size()]; for (int i = 0; i < mWifiUsabilityStatsEntriesList.size(); i++) { -- cgit v1.2.3