diff options
author | Oscar Shu <xshu@google.com> | 2019-05-28 19:33:52 +0000 |
---|---|---|
committer | Oscar Shu <xshu@google.com> | 2019-05-29 17:38:10 +0000 |
commit | d3e3342fb016e6f92202322abc9040eb29e96883 (patch) | |
tree | 416816926cc24772a9d26bcc9e010bf75a8602d9 /tests/wifitests/src/com/android/server/wifi/WifiLastResortWatchdogTest.java | |
parent | c6cb88c37c22daeeac819726cc91b6c452791a46 (diff) | |
download | android_frameworks_opt_net_wifi-d3e3342fb016e6f92202322abc9040eb29e96883.tar.gz android_frameworks_opt_net_wifi-d3e3342fb016e6f92202322abc9040eb29e96883.tar.bz2 android_frameworks_opt_net_wifi-d3e3342fb016e6f92202322abc9040eb29e96883.zip |
Revert "Trigger bugreport for abnormally long connections"
This reverts commit c6cb88c37c22daeeac819726cc91b6c452791a46.
Reason for revert:
This change will likely cause a flood of bugreports from beta users.
The plan is remove this from Beta5, so reverting now and will submit this CL again after Beta5 snap to only run the experiment on droidfood daily users.
Bug: 132648941
Test: Unit tests
Change-Id: Ie4a7319c7d4bf6216612d8528c4d78ac4e7b677e
Diffstat (limited to 'tests/wifitests/src/com/android/server/wifi/WifiLastResortWatchdogTest.java')
-rw-r--r-- | tests/wifitests/src/com/android/server/wifi/WifiLastResortWatchdogTest.java | 39 |
1 files changed, 0 insertions, 39 deletions
diff --git a/tests/wifitests/src/com/android/server/wifi/WifiLastResortWatchdogTest.java b/tests/wifitests/src/com/android/server/wifi/WifiLastResortWatchdogTest.java index dab283539..9ae382640 100644 --- a/tests/wifitests/src/com/android/server/wifi/WifiLastResortWatchdogTest.java +++ b/tests/wifitests/src/com/android/server/wifi/WifiLastResortWatchdogTest.java @@ -24,7 +24,6 @@ import static org.mockito.MockitoAnnotations.*; import android.net.wifi.WifiConfiguration; import android.net.wifi.WifiInfo; import android.net.wifi.WifiSsid; -import android.os.Handler; import android.os.test.TestLooper; import android.util.Pair; @@ -73,7 +72,6 @@ public class WifiLastResortWatchdogTest { mLastResortWatchdog.setBugReportProbability(1); when(mClientModeImpl.getWifiInfo()).thenReturn(mWifiInfo); when(mWifiInfo.getSSID()).thenReturn(TEST_NETWORK_SSID); - when(mWifiInjector.getClientModeImplHandler()).thenReturn(mLastResortWatchdog.getHandler()); } private List<Pair<ScanDetail, WifiConfiguration>> createFilteredQnsCandidates(String[] ssids, @@ -2154,41 +2152,4 @@ public class WifiLastResortWatchdogTest { verify(mWifiMetrics, times(1)).incrementNumLastResortWatchdogSuccesses(); } - /** - * Verifies that when a connection takes too long (time difference between - * StaEvent.TYPE_CMD_START_CONNECT and StaEvent.TYPE_NETWORK_CONNECTION_EVENT) a bugreport is - * taken. - */ - @Test - public void testAbnormalConnectionTimeTriggersBugreport() throws Exception { - // first verifies that bugreports are not taken when connection takes less than - // WifiLastResortWatchdog.ABNORMAL_SUCCESSFUL_CONNECTION_DURATION_MS - when(mClock.getElapsedSinceBootMillis()).thenReturn(1L); - mLastResortWatchdog.noteStartConnectTime(); - when(mClock.getElapsedSinceBootMillis()).thenReturn( - (long) WifiLastResortWatchdog.ABNORMAL_SUCCESSFUL_CONNECTION_DURATION_MS); - Handler handler = mLastResortWatchdog.getHandler(); - handler.sendMessage( - handler.obtainMessage(WifiMonitor.NETWORK_CONNECTION_EVENT, 0, 0, null)); - mLooper.dispatchAll(); - verify(mClientModeImpl, never()).takeBugReport(anyString(), anyString()); - - // Now verify that bugreport is taken - mLastResortWatchdog.noteStartConnectTime(); - when(mClock.getElapsedSinceBootMillis()).thenReturn( - (long) 2 * WifiLastResortWatchdog.ABNORMAL_SUCCESSFUL_CONNECTION_DURATION_MS + 1); - handler.sendMessage( - handler.obtainMessage(WifiMonitor.NETWORK_CONNECTION_EVENT, 0, 0, null)); - mLooper.dispatchAll(); - verify(mClientModeImpl).takeBugReport(anyString(), anyString()); - - // Verify additional connections (without more TYPE_CMD_START_CONNECT) don't trigger more - // bugreports. - when(mClock.getElapsedSinceBootMillis()).thenReturn( - (long) 4 * WifiLastResortWatchdog.ABNORMAL_SUCCESSFUL_CONNECTION_DURATION_MS); - handler.sendMessage( - handler.obtainMessage(WifiMonitor.NETWORK_CONNECTION_EVENT, 0, 0, null)); - mLooper.dispatchAll(); - verify(mClientModeImpl).takeBugReport(anyString(), anyString()); - } } |