summaryrefslogtreecommitdiffstats
path: root/wifi
diff options
context:
space:
mode:
authorRobert Greenwalt <rgreenwalt@google.com>2013-09-11 15:21:10 -0700
committerRobert Greenwalt <rgreenwalt@google.com>2013-09-12 14:23:51 -0700
commitdee971b98c3b084af54ae2f42b6fa3d4734d58d9 (patch)
tree8372ea3413ceb1bade0bcd74771bd3ebb9809ee9 /wifi
parent8f435baca8b5285a6b4658fc9563f5fcbbdafc6e (diff)
downloadframeworks_base-dee971b98c3b084af54ae2f42b6fa3d4734d58d9.zip
frameworks_base-dee971b98c3b084af54ae2f42b6fa3d4734d58d9.tar.gz
frameworks_base-dee971b98c3b084af54ae2f42b6fa3d4734d58d9.tar.bz2
Fix Batched Scan Results to give Timestamp in uS
ScanResult should have timestamp in uS but we are getting age in ms from the wifi driver - multiply to have the same units though not the implied precision. bug: 10410465 Change-Id: Idf5c5996d69a4793dae3d74edb790d40b9bd3298
Diffstat (limited to 'wifi')
-rw-r--r--wifi/java/android/net/wifi/WifiStateMachine.java4
1 files changed, 3 insertions, 1 deletions
diff --git a/wifi/java/android/net/wifi/WifiStateMachine.java b/wifi/java/android/net/wifi/WifiStateMachine.java
index 0f1aa71..ad89716 100644
--- a/wifi/java/android/net/wifi/WifiStateMachine.java
+++ b/wifi/java/android/net/wifi/WifiStateMachine.java
@@ -65,6 +65,7 @@ import android.os.PowerManager;
import android.os.Process;
import android.os.RemoteException;
import android.os.ServiceManager;
+import android.os.SystemClock;
import android.os.SystemProperties;
import android.os.UserHandle;
import android.os.WorkSource;
@@ -1016,7 +1017,7 @@ public class WifiStateMachine extends StateMachine {
int dist, distSd;
long tsf = 0;
dist = distSd = ScanResult.UNSPECIFIED;
- long now = System.currentTimeMillis();
+ long now = SystemClock.elapsedRealtime();
while (true) {
while (n < splitData.length) {
@@ -1064,6 +1065,7 @@ public class WifiStateMachine extends StateMachine {
} else if (splitData[n].startsWith(AGE)) {
try {
tsf = now - Long.parseLong(splitData[n].substring(AGE.length()));
+ tsf *= 1000; // convert mS -> uS
} catch (NumberFormatException e) {
loge("Invalid timestamp: " + splitData[n]);
tsf = 0;