summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorxshu <xshu@google.com>2020-03-30 17:10:29 -0700
committerxshu <xshu@google.com>2020-03-30 17:10:29 -0700
commit80a67d1ff05a0bdeb990b35f3e1588a83e174374 (patch)
tree513c9a875784e89c2930999a7be09e7499f0ee9b /tests
parent776f77aa028f52fc08c51da38b502014938850ce (diff)
Treat BSSIDs blocked by MBO same as other BSSIDs
It's observed that APs sometimes tell the framework to block BSSIDs for durations longer than the user's expectation, causing confusion and frustration to the user because they are not connecting the the network. The fix will make BSSIDs blocked by MBO available again when the user tap on a network or toggles wifi. Bug: 152155058 Test: atest com.android.server.wifi Change-Id: I786b11d29f248f740719e7c6083ac945431c0246
Diffstat (limited to 'tests')
-rw-r--r--tests/wifitests/src/com/android/server/wifi/BssidBlocklistMonitorTest.java13
1 files changed, 7 insertions, 6 deletions
diff --git a/tests/wifitests/src/com/android/server/wifi/BssidBlocklistMonitorTest.java b/tests/wifitests/src/com/android/server/wifi/BssidBlocklistMonitorTest.java
index 00afa91f1..2567faa91 100644
--- a/tests/wifitests/src/com/android/server/wifi/BssidBlocklistMonitorTest.java
+++ b/tests/wifitests/src/com/android/server/wifi/BssidBlocklistMonitorTest.java
@@ -628,14 +628,15 @@ public class BssidBlocklistMonitorTest {
when(mClock.getWallClockMillis()).thenReturn(0L);
long testDuration = 5500L;
mBssidBlocklistMonitor.blockBssidForDurationMs(TEST_BSSID_1, TEST_SSID_1, testDuration);
+ assertEquals(1, mBssidBlocklistMonitor.updateAndGetBssidBlocklist().size());
- // Verify that the BSSID is not removed from blocklist dispite of regular "clear" calls.
- when(mClock.getWallClockMillis()).thenReturn(testDuration);
- mBssidBlocklistMonitor.clearBssidBlocklist();
+ // Verify that the BSSID is removed from blocklist by clearBssidBlocklistForSsid
mBssidBlocklistMonitor.clearBssidBlocklistForSsid(TEST_SSID_1);
- Set<String> bssidList = mBssidBlocklistMonitor.updateAndGetBssidBlocklist();
- assertEquals(1, bssidList.size());
- assertTrue(bssidList.contains(TEST_BSSID_1));
+ assertEquals(0, mBssidBlocklistMonitor.updateAndGetBssidBlocklist().size());
+
+ // Add the BSSID to blocklist again.
+ mBssidBlocklistMonitor.blockBssidForDurationMs(TEST_BSSID_1, TEST_SSID_1, testDuration);
+ assertEquals(1, mBssidBlocklistMonitor.updateAndGetBssidBlocklist().size());
// Verify that the BSSID is removed from blocklist once the specified duration is over.
when(mClock.getWallClockMillis()).thenReturn(testDuration + 1);