summaryrefslogtreecommitdiff
path: root/service
diff options
context:
space:
mode:
authorOscar Shu <xshu@google.com>2019-05-28 19:33:52 +0000
committerOscar Shu <xshu@google.com>2019-05-29 17:38:10 +0000
commitd3e3342fb016e6f92202322abc9040eb29e96883 (patch)
tree416816926cc24772a9d26bcc9e010bf75a8602d9 /service
parentc6cb88c37c22daeeac819726cc91b6c452791a46 (diff)
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 'service')
-rw-r--r--service/java/com/android/server/wifi/ClientModeImpl.java3
-rw-r--r--service/java/com/android/server/wifi/WifiLastResortWatchdog.java48
2 files changed, 0 insertions, 51 deletions
diff --git a/service/java/com/android/server/wifi/ClientModeImpl.java b/service/java/com/android/server/wifi/ClientModeImpl.java
index 008135051..4adf27ff0 100644
--- a/service/java/com/android/server/wifi/ClientModeImpl.java
+++ b/service/java/com/android/server/wifi/ClientModeImpl.java
@@ -955,8 +955,6 @@ public class ClientModeImpl extends StateMachine {
mWifiMetrics.getHandler());
mWifiMonitor.registerHandler(mInterfaceName, CMD_TARGET_BSSID,
mWifiMetrics.getHandler());
- mWifiMonitor.registerHandler(mInterfaceName, WifiMonitor.NETWORK_CONNECTION_EVENT,
- mWifiInjector.getWifiLastResortWatchdog().getHandler());
}
private void setMulticastFilter(boolean enabled) {
@@ -4276,7 +4274,6 @@ public class ClientModeImpl extends StateMachine {
mWifiInfo.setMacAddress(currentMacAddress);
Log.i(TAG, "Connecting with " + currentMacAddress + " as the mac address");
if (mWifiNative.connectToNetwork(mInterfaceName, config)) {
- mWifiInjector.getWifiLastResortWatchdog().noteStartConnectTime();
mWifiMetrics.logStaEvent(StaEvent.TYPE_CMD_START_CONNECT, config);
mLastConnectAttemptTimestamp = mClock.getWallClockMillis();
mTargetWifiConfiguration = config;
diff --git a/service/java/com/android/server/wifi/WifiLastResortWatchdog.java b/service/java/com/android/server/wifi/WifiLastResortWatchdog.java
index 286e4ba47..6889b5016 100644
--- a/service/java/com/android/server/wifi/WifiLastResortWatchdog.java
+++ b/service/java/com/android/server/wifi/WifiLastResortWatchdog.java
@@ -20,7 +20,6 @@ import android.net.wifi.ScanResult;
import android.net.wifi.WifiConfiguration;
import android.os.Handler;
import android.os.Looper;
-import android.os.Message;
import android.text.TextUtils;
import android.util.LocalLog;
import android.util.Log;
@@ -75,8 +74,6 @@ public class WifiLastResortWatchdog {
// Number of milliseconds to wait before re-enable Watchdog triger
@VisibleForTesting
public static final long LAST_TRIGGER_TIMEOUT_MILLIS = 2 * 3600 * 1000; // 2 hours
- @VisibleForTesting
- public static final int ABNORMAL_SUCCESSFUL_CONNECTION_DURATION_MS = 1000 * 30; // 30 seconds
/**
* Cached WifiConfigurations of available networks seen within MAX_BSSID_AGE scan results
@@ -108,8 +105,6 @@ public class WifiLastResortWatchdog {
// If any connection failure happened after watchdog triggering restart then assume watchdog
// did not fix the problem
private boolean mWatchdogFixedWifi = true;
- private long mLastStartConnectTime = 0;
- private Handler mHandler;
/**
* Local log used for debugging any WifiLastResortWatchdog issues.
@@ -123,49 +118,6 @@ public class WifiLastResortWatchdog {
mWifiMetrics = wifiMetrics;
mClientModeImpl = clientModeImpl;
mClientModeImplLooper = clientModeImplLooper;
- mHandler = new Handler(clientModeImplLooper) {
- public void handleMessage(Message msg) {
- processMessage(msg);
- }
- };
- }
-
- /**
- * Returns handler for L2 events from supplicant.
- * @return Handler
- */
- public Handler getHandler() {
- return mHandler;
- }
-
- /**
- * Refreshes when the last CMD_START_CONNECT is triggered.
- */
- public void noteStartConnectTime() {
- mLastStartConnectTime = mClock.getElapsedSinceBootMillis();
- }
-
- private void processMessage(Message msg) {
- switch (msg.what) {
- case WifiMonitor.NETWORK_CONNECTION_EVENT:
- // Trigger bugreport for successful connections that take abnormally long
- if (mLastStartConnectTime > 0) {
- long durationMs = mClock.getElapsedSinceBootMillis() - mLastStartConnectTime;
- if (durationMs > ABNORMAL_SUCCESSFUL_CONNECTION_DURATION_MS) {
- final String bugTitle = "Wi-Fi Bugreport: Abnormal connection time";
- final String bugDetail = "Expected connection to take less than "
- + ABNORMAL_SUCCESSFUL_CONNECTION_DURATION_MS + " milliseconds. "
- + "Actually took " + durationMs + " milliseconds.";
- mWifiInjector.getClientModeImplHandler().post(() -> {
- mClientModeImpl.takeBugReport(bugTitle, bugDetail);
- });
- }
- mLastStartConnectTime = 0;
- }
- break;
- default:
- return;
- }
}
/**