From a529fb6e954c507ac5ccd53e4cf57befc7886b70 Mon Sep 17 00:00:00 2001 From: xshu Date: Wed, 27 Nov 2019 13:53:31 -0800 Subject: Limit watchdog check to device related failures The WifiLastResortWatchdog should only be monitoring failures that could be caused by the device. For unrelated failures we should block the AP without waiting for watchdog trigger. Bug: 139287182 Test: atest FrameworksWifiTests Test: on device sanity check Change-Id: Ide081b5be1af643449076fb259a417a4ce171345 --- .../com/android/server/wifi/BssidBlocklistMonitorTest.java | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'tests') diff --git a/tests/wifitests/src/com/android/server/wifi/BssidBlocklistMonitorTest.java b/tests/wifitests/src/com/android/server/wifi/BssidBlocklistMonitorTest.java index 3d397a241..7f72269bd 100644 --- a/tests/wifitests/src/com/android/server/wifi/BssidBlocklistMonitorTest.java +++ b/tests/wifitests/src/com/android/server/wifi/BssidBlocklistMonitorTest.java @@ -396,7 +396,8 @@ public class BssidBlocklistMonitorTest { /** * Verify that a BSSID is not added to blocklist as long as - * mWifiLastResortWatchdog.shouldIgnoreBssidUpdate is returning true. + * mWifiLastResortWatchdog.shouldIgnoreBssidUpdate is returning true, for failure reasons + * that are also being tracked by the watchdog. */ @Test public void testWatchdogIsGivenChanceToTrigger() { @@ -413,6 +414,17 @@ public class BssidBlocklistMonitorTest { assertTrue(mBssidBlocklistMonitor.updateAndGetBssidBlocklist().contains(TEST_BSSID_1)); } + /** + * Verify that non device related errors, and errors that are not monitored by the watchdog + * bypasses the watchdog check. + */ + @Test + public void testUnrelatedErrorsBypassWatchdogCheck() { + when(mWifiLastResortWatchdog.shouldIgnoreBssidUpdate(anyString())).thenReturn(true); + verifyAddTestBssidToBlocklist(); + verify(mWifiLastResortWatchdog, never()).shouldIgnoreBssidUpdate(anyString()); + } + /** * Verify that we are correctly filtering by SSID when sending a blocklist down to firmware. */ -- cgit v1.2.3