summaryrefslogtreecommitdiffstats
path: root/wifi
diff options
context:
space:
mode:
authorVinit Deshpande <vinitd@google.com>2015-03-09 19:01:39 -0700
committerVinit Deshpande <vinitd@google.com>2015-03-09 19:01:39 -0700
commit0019e53e11b5387dbb037db52ff4833fe58cc651 (patch)
tree7720add35af0f2788c695c69a90ff833cdca6bfa /wifi
parentbc93466e5a9bad7d1bbde32e1fdf4de6205cb015 (diff)
parent6e58424f5b052531a724a54629f00915ad3edada (diff)
downloadframeworks_base-0019e53e11b5387dbb037db52ff4833fe58cc651.zip
frameworks_base-0019e53e11b5387dbb037db52ff4833fe58cc651.tar.gz
frameworks_base-0019e53e11b5387dbb037db52ff4833fe58cc651.tar.bz2
am "add 2 side RTT support on scan"
merged from partner/m-wireless-wifi-dev 6e58424 add 2 side RTT support on scan
Diffstat (limited to 'wifi')
-rw-r--r--wifi/java/android/net/wifi/ScanResult.java92
-rw-r--r--wifi/java/android/net/wifi/WifiScanner.java4
2 files changed, 92 insertions, 4 deletions
diff --git a/wifi/java/android/net/wifi/ScanResult.java b/wifi/java/android/net/wifi/ScanResult.java
index 994f180..b4f4927 100644
--- a/wifi/java/android/net/wifi/ScanResult.java
+++ b/wifi/java/android/net/wifi/ScanResult.java
@@ -55,11 +55,55 @@ public class ScanResult implements Parcelable {
*/
public int level;
/**
- * The frequency in MHz of the channel over which the client is communicating
+ * The primary 20 MHz frequency (in MHz) of the channel over which the client is communicating
* with the access point.
*/
public int frequency;
+ /**
+ * AP Channel bandwidth is 20 MHZ
+ */
+ public static final int CHANNEL_WIDTH_20MHZ = 0;
+ /**
+ * AP Channel bandwidth is 40 MHZ
+ */
+ public static final int CHANNEL_WIDTH_40MHZ = 1;
+ /**
+ * AP Channel bandwidth is 80 MHZ
+ */
+ public static final int CHANNEL_WIDTH_80MHZ = 2;
+ /**
+ * AP Channel bandwidth is 160 MHZ
+ */
+ public static final int CHANNEL_WIDTH_160MHZ = 3;
+ /**
+ * AP Channel bandwidth is 160 MHZ, but 80MHZ + 80MHZ
+ */
+ public static final int CHANNEL_WIDTH_80MHZ_PLUS_MHZ = 4;
+
+ /**
+ * AP Channel bandwidth
+ */
+ public int channelWidth;
+
+ /**
+ * Not used if the AP bandwidth is 20 MHz
+ * If the AP use 40, 80 or 160 MHz, this is the center frequency
+ * if the AP use 80 + 80 MHz, this is the center frequency of the first segment
+ */
+ public int centerFreq0;
+
+ /**
+ * Only used if the AP bandwidth is 80 + 80 MHz
+ * if the AP use 80 + 80 MHz, this is the center frequency of the second segment
+ */
+ public int centerFreq1;
+
+ /**
+ * Whether the AP support 802.11mc Responder
+ */
+ public boolean is80211McRTTResponder;
+
/**
* timestamp in microseconds (since boot) when
* this result was last seen.
@@ -244,6 +288,10 @@ public class ScanResult implements Parcelable {
this.timestamp = tsf;
this.distanceCm = UNSPECIFIED;
this.distanceSdCm = UNSPECIFIED;
+ this.channelWidth = UNSPECIFIED;
+ this.centerFreq0 = UNSPECIFIED;
+ this.centerFreq1 = UNSPECIFIED;
+ this.is80211McRTTResponder = false;
}
/** {@hide} */
@@ -258,6 +306,29 @@ public class ScanResult implements Parcelable {
this.timestamp = tsf;
this.distanceCm = distCm;
this.distanceSdCm = distSdCm;
+ this.channelWidth = UNSPECIFIED;
+ this.centerFreq0 = UNSPECIFIED;
+ this.centerFreq1 = UNSPECIFIED;
+ this.is80211McRTTResponder = false;
+ }
+
+ /** {@hide} */
+ public ScanResult(WifiSsid wifiSsid, String BSSID, String caps, int level, int frequency,
+ long tsf, int distCm, int distSdCm, int channelWidth, int centerFreq0, int centerFreq1,
+ boolean is80211McRTTResponder) {
+ this.wifiSsid = wifiSsid;
+ this.SSID = (wifiSsid != null) ? wifiSsid.toString() : WifiSsid.NONE;
+ this.BSSID = BSSID;
+ this.capabilities = caps;
+ this.level = level;
+ this.frequency = frequency;
+ this.timestamp = tsf;
+ this.distanceCm = distCm;
+ this.distanceSdCm = distSdCm;
+ this.channelWidth = channelWidth;
+ this.centerFreq0 = centerFreq0;
+ this.centerFreq1 = centerFreq1;
+ this.is80211McRTTResponder = is80211McRTTResponder;
}
/** copy constructor {@hide} */
@@ -269,6 +340,10 @@ public class ScanResult implements Parcelable {
capabilities = source.capabilities;
level = source.level;
frequency = source.frequency;
+ channelWidth = source.channelWidth;
+ centerFreq0 = source.centerFreq0;
+ centerFreq1 = source.centerFreq1;
+ is80211McRTTResponder = source.is80211McRTTResponder;
timestamp = source.timestamp;
distanceCm = source.distanceCm;
distanceSdCm = source.distanceSdCm;
@@ -317,6 +392,11 @@ public class ScanResult implements Parcelable {
if (autoJoinStatus != 0) {
sb.append(", status: ").append(autoJoinStatus);
}
+ sb.append(", ChannelBandwidth: ").append(channelWidth);
+ sb.append(", centerFreq0: ").append(centerFreq0);
+ sb.append(", centerFreq1: ").append(centerFreq1);
+ sb.append(", 80211mcResponder: ").append(is80211McRTTResponder?
+ "is supported":"is not supported");
return sb.toString();
}
@@ -340,6 +420,10 @@ public class ScanResult implements Parcelable {
dest.writeLong(timestamp);
dest.writeInt(distanceCm);
dest.writeInt(distanceSdCm);
+ dest.writeInt(channelWidth);
+ dest.writeInt(centerFreq0);
+ dest.writeInt(centerFreq1);
+ dest.writeInt(is80211McRTTResponder ? 1 : 0);
dest.writeLong(seen);
dest.writeInt(autoJoinStatus);
dest.writeInt(untrusted ? 1 : 0);
@@ -381,7 +465,11 @@ public class ScanResult implements Parcelable {
in.readInt(),
in.readLong(),
in.readInt(),
- in.readInt()
+ in.readInt(),
+ in.readInt(),
+ in.readInt(),
+ in.readInt(),
+ in.readInt() == 1
);
sr.seen = in.readLong();
sr.autoJoinStatus = in.readInt();
diff --git a/wifi/java/android/net/wifi/WifiScanner.java b/wifi/java/android/net/wifi/WifiScanner.java
index f3cf28b..cecd738 100644
--- a/wifi/java/android/net/wifi/WifiScanner.java
+++ b/wifi/java/android/net/wifi/WifiScanner.java
@@ -251,8 +251,8 @@ public class WifiScanner {
for (int i = 0; i < s.mResults.length; i++) {
ScanResult result = s.mResults[i];
WifiSsid wifiSsid = WifiSsid.createFromAsciiEncoded(result.SSID);
- ScanResult newResult = new ScanResult(wifiSsid, result.BSSID, "",
- result.level, result.frequency, result.timestamp);
+ ScanResult newResult = new ScanResult(result);
+ newResult.wifiSsid = wifiSsid;
mResults[i] = newResult;
}
}