diff options
author | Kai Shi <kaishi@google.com> | 2020-09-20 04:19:16 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2020-09-20 04:19:16 +0000 |
commit | d5563129502a84afad6f44fa4c14c72e64730c8f (patch) | |
tree | d58fbf9fce3260d253b5268563be335a0fcae1fb /wifi/java/android/net | |
parent | ab64b3236052feb6ce6f039bf8c04abaacac2c97 (diff) | |
parent | dc0c7a41eae1e38c4a0ad09e91aa205f3d26a4f7 (diff) |
Merge "Bug fix of 6GHz band channelization" into rvc-qpr-dev
Diffstat (limited to 'wifi/java/android/net')
-rw-r--r-- | wifi/java/android/net/wifi/ScanResult.java | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/wifi/java/android/net/wifi/ScanResult.java b/wifi/java/android/net/wifi/ScanResult.java index aa3a13925894..b276f2ed4761 100644 --- a/wifi/java/android/net/wifi/ScanResult.java +++ b/wifi/java/android/net/wifi/ScanResult.java @@ -581,12 +581,18 @@ public final class ScanResult implements Parcelable { * 6 GHz band frequency of first channel in MHz * @hide */ - public static final int BAND_6_GHZ_START_FREQ_MHZ = 5945; + public static final int BAND_6_GHZ_START_FREQ_MHZ = 5955; /** * 6 GHz band frequency of last channel in MHz * @hide */ - public static final int BAND_6_GHZ_END_FREQ_MHZ = 7105; + public static final int BAND_6_GHZ_END_FREQ_MHZ = 7115; + + /** + * 6 GHz band operating class 136 channel 2 center frequency in MHz + * @hide + */ + public static final int BAND_6_GHZ_OP_CLASS_136_CH_2_FREQ_MHZ = 5935; /** * Utility function to check if a frequency within 2.4 GHz band @@ -618,7 +624,10 @@ public final class ScanResult implements Parcelable { * @hide */ public static boolean is6GHz(int freqMhz) { - return freqMhz >= BAND_6_GHZ_START_FREQ_MHZ && freqMhz <= BAND_6_GHZ_END_FREQ_MHZ; + if (freqMhz == BAND_6_GHZ_OP_CLASS_136_CH_2_FREQ_MHZ) { + return true; + } + return (freqMhz >= BAND_6_GHZ_START_FREQ_MHZ && freqMhz <= BAND_6_GHZ_END_FREQ_MHZ); } /** @@ -649,6 +658,9 @@ public final class ScanResult implements Parcelable { } if (band == WifiScanner.WIFI_BAND_6_GHZ) { if (channel >= BAND_6_GHZ_FIRST_CH_NUM && channel <= BAND_6_GHZ_LAST_CH_NUM) { + if (channel == 2) { + return BAND_6_GHZ_OP_CLASS_136_CH_2_FREQ_MHZ; + } return ((channel - BAND_6_GHZ_FIRST_CH_NUM) * 5) + BAND_6_GHZ_START_FREQ_MHZ; } else { return UNSPECIFIED; @@ -673,6 +685,9 @@ public final class ScanResult implements Parcelable { } else if (is5GHz(freqMhz)) { return ((freqMhz - BAND_5_GHZ_START_FREQ_MHZ) / 5) + BAND_5_GHZ_FIRST_CH_NUM; } else if (is6GHz(freqMhz)) { + if (freqMhz == BAND_6_GHZ_OP_CLASS_136_CH_2_FREQ_MHZ) { + return 2; + } return ((freqMhz - BAND_6_GHZ_START_FREQ_MHZ) / 5) + BAND_6_GHZ_FIRST_CH_NUM; } |