diff options
author | TreeHugger Robot <treehugger-gerrit@google.com> | 2017-08-31 19:04:32 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2017-08-31 19:04:32 +0000 |
commit | d2c7a6041bbdf91d3cedbcb16ca06d37f449d95a (patch) | |
tree | e3b0cbd5a9e45b65a1c2ce4a6ea3c59ba92dddaa /service | |
parent | b3592f242d47784024bc244d8814f68fa46d22c6 (diff) | |
parent | bc3a847de5a76a2f1f3a75c46e1cc76d02673ada (diff) |
Merge "Fix scan result age on log dumping" into oc-mr1-dev
Diffstat (limited to 'service')
-rw-r--r-- | service/java/com/android/server/wifi/scanner/WifiScanningServiceImpl.java | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/service/java/com/android/server/wifi/scanner/WifiScanningServiceImpl.java b/service/java/com/android/server/wifi/scanner/WifiScanningServiceImpl.java index ab2a5dca3..4b8e284cc 100644 --- a/service/java/com/android/server/wifi/scanner/WifiScanningServiceImpl.java +++ b/service/java/com/android/server/wifi/scanner/WifiScanningServiceImpl.java @@ -2129,20 +2129,21 @@ public class WifiScanningServiceImpl extends IWifiScanner.Stub { pw.println(); pw.println("Latest scan results:"); List<ScanResult> scanResults = mSingleScanStateMachine.getCachedScanResultsAsList(); - long nowMs = System.currentTimeMillis(); + long nowMs = mClock.getElapsedSinceBootMillis(); if (scanResults != null && scanResults.size() != 0) { pw.println(" BSSID Frequency RSSI Age(sec) SSID " + " Flags"); for (ScanResult r : scanResults) { + long timeStampMs = r.timestamp / 1000; String age; - if (r.seen <= 0) { + if (timeStampMs <= 0) { age = "___?___"; - } else if (nowMs < r.seen) { + } else if (nowMs < timeStampMs) { age = " 0.000"; - } else if (r.seen < nowMs - 1000000) { + } else if (timeStampMs < nowMs - 1000000) { age = ">1000.0"; } else { - age = String.format("%3.3f", (nowMs - r.seen) / 1000.0); + age = String.format("%3.3f", (nowMs - timeStampMs) / 1000.0); } String ssid = r.SSID == null ? "" : r.SSID; pw.printf(" %17s %9d %5d %7s %-32s %s\n", |