summaryrefslogtreecommitdiffstats
path: root/wifi/java/android/net/wifi/ScanResult.java
diff options
context:
space:
mode:
authorIrfan Sheriff <isheriff@google.com>2012-08-10 16:13:09 -0700
committerIrfan Sheriff <isheriff@google.com>2012-08-13 11:20:14 -0700
commitb31f78f93768fef269617ec788a5c6655a375f80 (patch)
treec4206fc3520ec50205046b01a48b21e9e53aaa14 /wifi/java/android/net/wifi/ScanResult.java
parent3fb4ba616edb114b3197936eb67f481eb86b7cae (diff)
downloadframeworks_base-b31f78f93768fef269617ec788a5c6655a375f80.zip
frameworks_base-b31f78f93768fef269617ec788a5c6655a375f80.tar.gz
frameworks_base-b31f78f93768fef269617ec788a5c6655a375f80.tar.bz2
Add timestamp in scan results
Propogate 802.11 tsf details per scan result to the applications and open up hidden access points BUg: 2961159 Change-Id: I05658fd0cf010c0b36193db3f79422640e8b3a6b
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()
);
}