summaryrefslogtreecommitdiffstats
path: root/service
diff options
context:
space:
mode:
authorOscar Shu <xshu@google.com>2019-05-29 17:38:22 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2019-05-29 17:38:22 +0000
commitd730fef342daccb305f4cc20576c98601d05e44b (patch)
tree09cb6eaada681caf9b878869109cc8227d3ee329 /service
parent8a2a97976f1ad31b0981abc134139a3252ea13f2 (diff)
parentd3e3342fb016e6f92202322abc9040eb29e96883 (diff)
downloadandroid_frameworks_opt_net_wifi-d730fef342daccb305f4cc20576c98601d05e44b.tar.gz
android_frameworks_opt_net_wifi-d730fef342daccb305f4cc20576c98601d05e44b.tar.bz2
android_frameworks_opt_net_wifi-d730fef342daccb305f4cc20576c98601d05e44b.zip
Merge "Revert "Trigger bugreport for abnormally long connections"" into qt-dev
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;
- }
}
/**