diff options
-rw-r--r-- | service/java/com/android/server/wifi/ClientModeImpl.java | 12 | ||||
-rw-r--r-- | tests/wifitests/src/com/android/server/wifi/ClientModeImplTest.java | 17 |
2 files changed, 14 insertions, 15 deletions
diff --git a/service/java/com/android/server/wifi/ClientModeImpl.java b/service/java/com/android/server/wifi/ClientModeImpl.java index 173e10d14..6941fbf7d 100644 --- a/service/java/com/android/server/wifi/ClientModeImpl.java +++ b/service/java/com/android/server/wifi/ClientModeImpl.java @@ -6095,11 +6095,6 @@ public class ClientModeImpl extends StateMachine { return; } - boolean isImminentBit = (frameData.mBssTmDataFlagsMask - & (MboOceConstants.BTM_DATA_FLAG_DISASSOCIATION_IMMINENT - | MboOceConstants.BTM_DATA_FLAG_BSS_TERMINATION_INCLUDED - | MboOceConstants.BTM_DATA_FLAG_ESS_DISASSOCIATION_IMMINENT)) != 0; - if ((frameData.mBssTmDataFlagsMask & MboOceConstants.BTM_DATA_FLAG_MBO_CELL_DATA_CONNECTION_PREFERENCE_INCLUDED) != 0) { @@ -6107,12 +6102,13 @@ public class ClientModeImpl extends StateMachine { } - if (isImminentBit) { + if ((frameData.mBssTmDataFlagsMask + & MboOceConstants.BTM_DATA_FLAG_MBO_ASSOC_RETRY_DELAY_INCLUDED) + != 0) { long duration = frameData.mBlackListDurationMs; if (duration == 0) { /* - * When AP sets one of the imminent bits and disassociation timer / BSS termination - * duration / MBO assoc retry delay is set to zero(reserved as per spec), + * When MBO assoc retry delay is set to zero(reserved as per spec), * blacklist the BSS for sometime to avoid AP rejecting the re-connect request. */ duration = MboOceConstants.DEFAULT_BLACKLIST_DURATION_MS; diff --git a/tests/wifitests/src/com/android/server/wifi/ClientModeImplTest.java b/tests/wifitests/src/com/android/server/wifi/ClientModeImplTest.java index 865d4ac25..60284978b 100644 --- a/tests/wifitests/src/com/android/server/wifi/ClientModeImplTest.java +++ b/tests/wifitests/src/com/android/server/wifi/ClientModeImplTest.java @@ -4130,18 +4130,20 @@ public class ClientModeImplTest extends WifiBaseTest { } /** - * Test that handleBssTransitionRequest() blacklist the BSS when - * imminent bit is set. + * Test that handleBssTransitionRequest() blacklist the BSS upon + * receiving BTM request frame that contains MBO-OCE IE with an + * association retry delay attribute. */ @Test - public void testBtmFrameWithImminentBitBlackListTheBssid() throws Exception { + public void testBtmFrameWithMboAssocretryDelayBlackListTheBssid() throws Exception { // Connect to network with |sBSSID|, |sFreq|. connect(); MboOceController.BtmFrameData btmFrmData = new MboOceController.BtmFrameData(); btmFrmData.mStatus = MboOceConstants.BTM_RESPONSE_STATUS_REJECT_UNSPECIFIED; - btmFrmData.mBssTmDataFlagsMask = MboOceConstants.BTM_DATA_FLAG_DISASSOCIATION_IMMINENT; + btmFrmData.mBssTmDataFlagsMask = MboOceConstants.BTM_DATA_FLAG_DISASSOCIATION_IMMINENT + | MboOceConstants.BTM_DATA_FLAG_MBO_ASSOC_RETRY_DELAY_INCLUDED; btmFrmData.mBlackListDurationMs = 60000; mCmi.sendMessage(WifiMonitor.MBO_OCE_BSS_TM_HANDLING_DONE, btmFrmData); @@ -4164,14 +4166,15 @@ public class ClientModeImplTest extends WifiBaseTest { btmFrmData.mStatus = MboOceConstants.BTM_RESPONSE_STATUS_REJECT_UNSPECIFIED; btmFrmData.mBssTmDataFlagsMask = MboOceConstants.BTM_DATA_FLAG_DISASSOCIATION_IMMINENT + | MboOceConstants.BTM_DATA_FLAG_BSS_TERMINATION_INCLUDED | MboOceConstants.BTM_DATA_FLAG_MBO_CELL_DATA_CONNECTION_PREFERENCE_INCLUDED; - btmFrmData.mBlackListDurationMs = 0; + btmFrmData.mBlackListDurationMs = 60000; mCmi.sendMessage(WifiMonitor.MBO_OCE_BSS_TM_HANDLING_DONE, btmFrmData); mLooper.dispatchAll(); - verify(mBssidBlocklistMonitor).blockBssidForDurationMs(sBSSID, sSSID, - MboOceConstants.DEFAULT_BLACKLIST_DURATION_MS); + verify(mBssidBlocklistMonitor, never()).blockBssidForDurationMs(sBSSID, sSSID, + btmFrmData.mBlackListDurationMs); verify(mWifiConnectivityManager).forceConnectivityScan(ClientModeImpl.WIFI_WORK_SOURCE); verify(mWifiMetrics, times(1)).incrementMboCellularSwitchRequestCount(); verify(mWifiMetrics, times(1)) |