From 5eec0acd38359b809ff2ec5684aefc9761cf61d2 Mon Sep 17 00:00:00 2001 From: maheshkkv Date: Wed, 8 Jan 2025 11:00:03 -0800 Subject: Fix RTT preamble based on band and RTT type The IEEE 802.11mc standard is only compatible with HE and EHT technologies when using the 6 GHz band. However, the IEEE 802.11az standard supports HE and EHT across all Wi-Fi bands (2.4 GHz, 5 GHz, and 6 GHz). BYPASS_INCLUSIVE_LANGUAGE_REASON=HE refers to High Efficiency. Flag: EXEMPT bugfix Bug: 383975447 Test: atest android.net.wifi Change-Id: I185d3e0e2180849c9c52bc25b409311606738ce9 --- framework/java/android/net/wifi/rtt/ResponderConfig.java | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'framework/java') diff --git a/framework/java/android/net/wifi/rtt/ResponderConfig.java b/framework/java/android/net/wifi/rtt/ResponderConfig.java index 213c8ed801..5b4f2da08a 100644 --- a/framework/java/android/net/wifi/rtt/ResponderConfig.java +++ b/framework/java/android/net/wifi/rtt/ResponderConfig.java @@ -439,6 +439,10 @@ public final class ResponderConfig implements Parcelable { int centerFreq1 = scanResult.centerFreq1; int preamble; + // The IEEE 802.11mc is only compatible with HE and EHT when using the 6 GHz band. + // However, the IEEE 802.11az supports HE and EHT across all Wi-Fi bands (2.4GHz, 5 GHz, + // and 6 GHz). + boolean isHeOrEhtAllowed = supports80211azNtbRanging || ScanResult.is6GHz(frequency); if (scanResult.informationElements != null && scanResult.informationElements.length != 0) { boolean htCapabilitiesPresent = false; boolean vhtCapabilitiesPresent = false; @@ -457,9 +461,9 @@ public final class ResponderConfig implements Parcelable { } } - if (ehtCapabilitiesPresent && ScanResult.is6GHz(frequency)) { + if (ehtCapabilitiesPresent && isHeOrEhtAllowed) { preamble = ScanResult.PREAMBLE_EHT; - } else if (heCapabilitiesPresent && ScanResult.is6GHz(frequency)) { + } else if (heCapabilitiesPresent && isHeOrEhtAllowed) { preamble = ScanResult.PREAMBLE_HE; } else if (vhtCapabilitiesPresent) { preamble = ScanResult.PREAMBLE_VHT; @@ -470,9 +474,10 @@ public final class ResponderConfig implements Parcelable { } } else { Log.e(TAG, "Scan Results do not contain IEs - using backup method to select preamble"); - if (channelWidth == ScanResult.CHANNEL_WIDTH_320MHZ) { + if (channelWidth == ScanResult.CHANNEL_WIDTH_320MHZ && isHeOrEhtAllowed) { preamble = ScanResult.PREAMBLE_EHT; - } else if (channelWidth == ScanResult.CHANNEL_WIDTH_80MHZ + } else if (channelWidth == ScanResult.CHANNEL_WIDTH_320MHZ + || channelWidth == ScanResult.CHANNEL_WIDTH_80MHZ || channelWidth == ScanResult.CHANNEL_WIDTH_160MHZ) { preamble = ScanResult.PREAMBLE_VHT; } else { -- cgit v1.2.3-59-g8ed1b