diff options
author | Robert Greenwalt <rgreenwalt@google.com> | 2013-09-13 00:04:30 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2013-09-13 00:04:30 +0000 |
commit | 14e55996722db1e74996b837c136a6e188143718 (patch) | |
tree | 7b027dee0c5a901ce69769b3781545f39f7ef6d5 /wifi | |
parent | 5fbfb81d31d452f75bc088d380711642993fef1c (diff) | |
parent | dee971b98c3b084af54ae2f42b6fa3d4734d58d9 (diff) | |
download | frameworks_base-14e55996722db1e74996b837c136a6e188143718.zip frameworks_base-14e55996722db1e74996b837c136a6e188143718.tar.gz frameworks_base-14e55996722db1e74996b837c136a6e188143718.tar.bz2 |
Merge "Fix Batched Scan Results to give Timestamp in uS" into klp-dev
Diffstat (limited to 'wifi')
-rw-r--r-- | wifi/java/android/net/wifi/WifiStateMachine.java | 4 |
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; |