diff options
author | Vinit Deshpande <vinitd@google.com> | 2015-03-15 13:42:38 -0700 |
---|---|---|
committer | Vinit Deshpande <vinitd@google.com> | 2015-03-15 13:42:38 -0700 |
commit | fd67bf63e629c217a4f6f0b2e54f0a5965bba4ed (patch) | |
tree | 37a8764bd1cc61eb5eba3a10eb6489631bc2dce5 | |
parent | 503bdb519ebe25d91d1363ce62c02a9dae624fcb (diff) | |
parent | 6e58424f5b052531a724a54629f00915ad3edada (diff) | |
download | frameworks_base-fd67bf63e629c217a4f6f0b2e54f0a5965bba4ed.zip frameworks_base-fd67bf63e629c217a4f6f0b2e54f0a5965bba4ed.tar.gz frameworks_base-fd67bf63e629c217a4f6f0b2e54f0a5965bba4ed.tar.bz2 |
am "add 2 side RTT support on scan"
merged from goog/mirror-m-wireless-internal-release
6e58424 add 2 side RTT support on scan
-rw-r--r-- | api/current.txt | 9 | ||||
-rw-r--r-- | wifi/java/android/net/wifi/ScanResult.java | 92 | ||||
-rw-r--r-- | wifi/java/android/net/wifi/WifiScanner.java | 4 |
3 files changed, 101 insertions, 4 deletions
diff --git a/api/current.txt b/api/current.txt index 4553ce1..bfe8f62 100644 --- a/api/current.txt +++ b/api/current.txt @@ -18440,9 +18440,18 @@ package android.net.wifi { method public int describeContents(); method public void writeToParcel(android.os.Parcel, int); field public java.lang.String BSSID; + field public static final int CHANNEL_WIDTH_160MHZ = 3; // 0x3 + field public static final int CHANNEL_WIDTH_20MHZ = 0; // 0x0 + field public static final int CHANNEL_WIDTH_40MHZ = 1; // 0x1 + field public static final int CHANNEL_WIDTH_80MHZ = 2; // 0x2 + field public static final int CHANNEL_WIDTH_80MHZ_PLUS_MHZ = 4; // 0x4 field public java.lang.String SSID; field public java.lang.String capabilities; + field public int centerFreq0; + field public int centerFreq1; + field public int channelWidth; field public int frequency; + field public boolean is80211McRTTResponder; field public int level; field public long timestamp; } 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; } } |