diff options
| author | 2020-09-08 06:24:25 +0000 | |
|---|---|---|
| committer | 2020-09-08 06:24:25 +0000 | |
| commit | 2001384f1c3563b217810ece306f95ce12413893 (patch) | |
| tree | d4c81761545429de96c3bf39fdc265f676328225 | |
| parent | 9a311b321c379f4821e8bedc72d1811db120780d (diff) | |
| parent | da114318424409377a821e3bf2e7e69eec08d92c (diff) | |
Merge "wifi: add basic support for 60GHz band"
4 files changed, 79 insertions, 0 deletions
diff --git a/packages/SettingsLib/src/com/android/settingslib/wifi/AccessPoint.java b/packages/SettingsLib/src/com/android/settingslib/wifi/AccessPoint.java index c5e66bef9653..a81a05f1147a 100644 --- a/packages/SettingsLib/src/com/android/settingslib/wifi/AccessPoint.java +++ b/packages/SettingsLib/src/com/android/settingslib/wifi/AccessPoint.java @@ -116,6 +116,16 @@ public class AccessPoint implements Comparable<AccessPoint> { */ public static final int HIGHER_FREQ_5GHZ = 5900; + /** + * Lower bound on the 60 GHz (802.11ad) WIGIG channels + */ + public static final int LOWER_FREQ_60GHZ = 58320; + + /** + * Upper bound on the 60 GHz (802.11ad) WIGIG channels + */ + public static final int HIGHER_FREQ_60GHZ = 70200; + /** The key which identifies this AccessPoint grouping. */ private String mKey; diff --git a/packages/SettingsLib/src/com/android/settingslib/wifi/WifiUtils.java b/packages/SettingsLib/src/com/android/settingslib/wifi/WifiUtils.java index 1ace0b4250b9..15b146deb1cb 100644 --- a/packages/SettingsLib/src/com/android/settingslib/wifi/WifiUtils.java +++ b/packages/SettingsLib/src/com/android/settingslib/wifi/WifiUtils.java @@ -93,6 +93,7 @@ public class WifiUtils { StringBuilder visibility = new StringBuilder(); StringBuilder scans24GHz = new StringBuilder(); StringBuilder scans5GHz = new StringBuilder(); + StringBuilder scans60GHz = new StringBuilder(); String bssid = null; if (accessPoint.isActive() && info != null) { @@ -115,9 +116,11 @@ public class WifiUtils { int maxRssi5 = INVALID_RSSI; int maxRssi24 = INVALID_RSSI; + int maxRssi60 = INVALID_RSSI; final int maxDisplayedScans = 4; int num5 = 0; // number of scanned BSSID on 5GHz band int num24 = 0; // number of scanned BSSID on 2.4Ghz band + int num60 = 0; // number of scanned BSSID on 60Ghz band int numBlockListed = 0; // TODO: sort list by RSSI or age @@ -152,6 +155,19 @@ public class WifiUtils { verboseScanResultSummary(accessPoint, result, bssid, nowMs)); } + } else if (result.frequency >= AccessPoint.LOWER_FREQ_60GHZ + && result.frequency <= AccessPoint.HIGHER_FREQ_60GHZ) { + // Strictly speaking: [60000, 61000] + num60++; + + if (result.level > maxRssi60) { + maxRssi60 = result.level; + } + if (num60 <= maxDisplayedScans) { + scans60GHz.append( + verboseScanResultSummary(accessPoint, result, bssid, + nowMs)); + } } } visibility.append(" ["); @@ -170,6 +186,14 @@ public class WifiUtils { } visibility.append(scans5GHz.toString()); } + visibility.append(";"); + if (num60 > 0) { + visibility.append("(").append(num60).append(")"); + if (num60 > maxDisplayedScans) { + visibility.append("max=").append(maxRssi60).append(","); + } + visibility.append(scans60GHz.toString()); + } if (numBlockListed > 0) { visibility.append("!").append(numBlockListed); } diff --git a/wifi/java/android/net/wifi/ScanResult.java b/wifi/java/android/net/wifi/ScanResult.java index 9302f78b7fca..54ec1e1c7c0b 100644 --- a/wifi/java/android/net/wifi/ScanResult.java +++ b/wifi/java/android/net/wifi/ScanResult.java @@ -595,6 +595,27 @@ public final class ScanResult implements Parcelable { public static final int BAND_6_GHZ_END_FREQ_MHZ = 7105; /** + * 60 GHz band first channel number + * @hide + */ + public static final int BAND_60_GHZ_FIRST_CH_NUM = 1; + /** + * 60 GHz band last channel number + * @hide + */ + public static final int BAND_60_GHZ_LAST_CH_NUM = 6; + /** + * 60 GHz band frequency of first channel in MHz + * @hide + */ + public static final int BAND_60_GHZ_START_FREQ_MHZ = 58320; + /** + * 60 GHz band frequency of last channel in MHz + * @hide + */ + public static final int BAND_60_GHZ_END_FREQ_MHZ = 70200; + + /** * Utility function to check if a frequency within 2.4 GHz band * @param freqMhz frequency in MHz * @return true if within 2.4GHz, false otherwise @@ -628,6 +649,17 @@ public final class ScanResult implements Parcelable { } /** + * Utility function to check if a frequency within 60 GHz band + * @param freqMhz + * @return true if within 60GHz, false otherwise + * + * @hide + */ + public static boolean is60GHz(int freqMhz) { + return freqMhz >= BAND_60_GHZ_START_FREQ_MHZ && freqMhz <= BAND_60_GHZ_END_FREQ_MHZ; + } + + /** * Utility function to convert channel number/band to frequency in MHz * @param channel number to convert * @param band of channel to convert @@ -707,6 +739,13 @@ public final class ScanResult implements Parcelable { } /** + * @hide + */ + public boolean is60GHz() { + return ScanResult.is60GHz(frequency); + } + + /** * @hide * anqp lines from supplicant BSS response */ diff --git a/wifi/java/android/net/wifi/WifiConfiguration.java b/wifi/java/android/net/wifi/WifiConfiguration.java index 79f61bb791f6..656444ea98db 100644 --- a/wifi/java/android/net/wifi/WifiConfiguration.java +++ b/wifi/java/android/net/wifi/WifiConfiguration.java @@ -596,6 +596,12 @@ public class WifiConfiguration implements Parcelable { public static final int AP_BAND_5GHZ = 1; /** + * 60GHz band + * @hide + */ + public static final int AP_BAND_60GHZ = 2; + + /** * Device is allowed to choose the optimal band (2Ghz or 5Ghz) based on device capability, * operating country code and current radio conditions. * @hide |