summaryrefslogtreecommitdiffstats
path: root/wifi/java/android/net/wifi/ScanResult.java
diff options
context:
space:
mode:
authorIliyan Malchev <malchev@google.com>2012-08-20 12:52:35 -0700
committerAndroid (Google) Code Review <android-gerrit@google.com>2012-08-20 12:52:35 -0700
commit06c43d575c88976f8709ff3fc0bad7117bde23e7 (patch)
tree7a1e1079fe571984f46cc4f9c9c87f46bdc0ed59 /wifi/java/android/net/wifi/ScanResult.java
parent578531082b8e8c8aa03868e69591b7613b0e8b8e (diff)
downloadframeworks_base-06c43d575c88976f8709ff3fc0bad7117bde23e7.zip
frameworks_base-06c43d575c88976f8709ff3fc0bad7117bde23e7.tar.gz
frameworks_base-06c43d575c88976f8709ff3fc0bad7117bde23e7.tar.bz2
Revert "Revert "Add timestamp in scan results""
With b/6979211 fixed, we can reinstate timestamps. This reverts commit 578531082b8e8c8aa03868e69591b7613b0e8b8e Change-Id: I5dffc8d9701004f7c6325f21e1e33d1cdd2d05c0
Diffstat (limited to 'wifi/java/android/net/wifi/ScanResult.java')
-rw-r--r--wifi/java/android/net/wifi/ScanResult.java30
1 files changed, 26 insertions, 4 deletions
diff --git a/wifi/java/android/net/wifi/ScanResult.java b/wifi/java/android/net/wifi/ScanResult.java
index 32261de..3e20756 100644
--- a/wifi/java/android/net/wifi/ScanResult.java
+++ b/wifi/java/android/net/wifi/ScanResult.java
@@ -47,19 +47,37 @@ public class ScanResult implements Parcelable {
public int frequency;
/**
+ * Time Synchronization Function (tsf) timestamp in microseconds when
+ * this result was last seen.
+ */
+ public long timestamp;
+
+ /**
* We'd like to obtain the following attributes,
* but they are not reported via the socket
* interface, even though they are known
* internally by wpa_supplicant.
* {@hide}
*/
- public ScanResult(String SSID, String BSSID, String caps, int level, int frequency) {
+ public ScanResult(String SSID, String BSSID, String caps, int level, int frequency, long tsf) {
this.SSID = SSID;
this.BSSID = BSSID;
this.capabilities = caps;
this.level = level;
this.frequency = frequency;
- //networkConfig = null;
+ this.timestamp = tsf;
+ }
+
+ /** copy constructor {@hide} */
+ public ScanResult(ScanResult source) {
+ if (source != null) {
+ SSID = source.SSID;
+ BSSID = source.BSSID;
+ capabilities = source.capabilities;
+ level = source.level;
+ frequency = source.frequency;
+ timestamp = source.timestamp;
+ }
}
@Override
@@ -76,7 +94,9 @@ public class ScanResult implements Parcelable {
append(", level: ").
append(level).
append(", frequency: ").
- append(frequency);
+ append(frequency).
+ append(", timestamp: ").
+ append(timestamp);
return sb.toString();
}
@@ -93,6 +113,7 @@ public class ScanResult implements Parcelable {
dest.writeString(capabilities);
dest.writeInt(level);
dest.writeInt(frequency);
+ dest.writeLong(timestamp);
}
/** Implement the Parcelable interface {@hide} */
@@ -104,7 +125,8 @@ public class ScanResult implements Parcelable {
in.readString(),
in.readString(),
in.readInt(),
- in.readInt()
+ in.readInt(),
+ in.readLong()
);
}