diff options
author | xshu <xshu@google.com> | 2018-04-18 15:44:06 -0700 |
---|---|---|
committer | xshu <xshu@google.com> | 2018-04-23 15:04:46 -0700 |
commit | d9d2a093b6f1613f08c72798f0dee7abdedc8213 (patch) | |
tree | 93a86e2c01cbe62c01a3ebbbf0579f424d1b5193 /service | |
parent | ac16e622382ff0b82b0b47c102938d5103ddb53a (diff) |
LRWD: Remove obsolete snapshot grabbing check
No longer need this because we are enforcing something even more strict.
Bug: 77655949
Test: compile, unit test
Change-Id: Ic48999b4b0dcb633085afb66bcc63400c143b4c8
Diffstat (limited to 'service')
-rw-r--r-- | service/java/com/android/server/wifi/WifiLastResortWatchdog.java | 15 | ||||
-rw-r--r-- | service/java/com/android/server/wifi/WifiStateMachine.java | 6 |
2 files changed, 4 insertions, 17 deletions
diff --git a/service/java/com/android/server/wifi/WifiLastResortWatchdog.java b/service/java/com/android/server/wifi/WifiLastResortWatchdog.java index 562af1d73..b83963ea0 100644 --- a/service/java/com/android/server/wifi/WifiLastResortWatchdog.java +++ b/service/java/com/android/server/wifi/WifiLastResortWatchdog.java @@ -26,11 +26,9 @@ import android.util.Pair; import com.android.internal.annotations.VisibleForTesting; import java.util.HashMap; -import java.util.HashSet; import java.util.Iterator; import java.util.List; import java.util.Map; -import java.util.Set; /** * This Class is a Work-In-Progress, intended behavior is as follows: @@ -82,9 +80,6 @@ public class WifiLastResortWatchdog { private Map<String, Pair<AvailableNetworkFailureCount, Integer>> mSsidFailureCount = new HashMap<>(); - // Set of SSIDs that watchdog tried to connect to before finally triggering a restart - private Set<String> mSsidAvailableAtFailure = new HashSet<>(); - // Tracks: if WifiStateMachine is in ConnectedState private boolean mWifiIsConnected = false; // Is Watchdog allowed to trigger now? Set to false after triggering. Set to true after @@ -229,8 +224,6 @@ public class WifiLastResortWatchdog { setWatchdogTriggerEnabled(false); mWatchdogFixedWifi = true; Log.e(TAG, "Watchdog triggering recovery"); - mSsidAvailableAtFailure.clear(); - mSsidAvailableAtFailure.addAll(mSsidFailureCount.keySet()); mTimeLastTrigger = mClock.getElapsedSinceBootMillis(); mSelfRecovery.trigger(SelfRecovery.REASON_LAST_RESORT_WATCHDOG); // increment various watchdog trigger count stats @@ -244,9 +237,8 @@ public class WifiLastResortWatchdog { * Handles transitions entering and exiting WifiStateMachine ConnectedState * Used to track wifistate, and perform watchdog count resetting * @param isEntering true if called from ConnectedState.enter(), false for exit() - * @param ssid the ssid of the network doing the transition */ - public void connectedStateTransition(boolean isEntering, String ssid) { + public void connectedStateTransition(boolean isEntering) { if (mVerboseLoggingEnabled) { Log.v(TAG, "connectedStateTransition: isEntering = " + isEntering); } @@ -255,10 +247,7 @@ public class WifiLastResortWatchdog { return; } if (!mWatchdogAllowedToTrigger && mWatchdogFixedWifi - && checkIfAtleastOneNetworkHasEverConnected() - && mSsidAvailableAtFailure.contains(ssid)) { - Log.e(TAG, "Wifi failed to connect on " + mSsidAvailableAtFailure.size() - + " networks but was able to reconnect to one of them after a restart."); + && checkIfAtleastOneNetworkHasEverConnected()) { takeBugReportWithCurrentProbability("Wifi fixed after restart"); // WiFi has connected after a Watchdog trigger, without any new networks becoming // available, log a Watchdog success in wifi metrics diff --git a/service/java/com/android/server/wifi/WifiStateMachine.java b/service/java/com/android/server/wifi/WifiStateMachine.java index 32427c92c..907cd2862 100644 --- a/service/java/com/android/server/wifi/WifiStateMachine.java +++ b/service/java/com/android/server/wifi/WifiStateMachine.java @@ -5339,9 +5339,8 @@ public class WifiStateMachine extends StateMachine { } mLastDriverRoamAttempt = 0; - String curSsid = getTargetSsid(); mTargetNetworkId = WifiConfiguration.INVALID_NETWORK_ID; - mWifiInjector.getWifiLastResortWatchdog().connectedStateTransition(true, curSsid); + mWifiInjector.getWifiLastResortWatchdog().connectedStateTransition(true); mWifiStateTracker.updateState(WifiStateTracker.CONNECTED); } @Override @@ -5496,8 +5495,7 @@ public class WifiStateMachine extends StateMachine { WifiConnectivityManager.WIFI_STATE_TRANSITIONING); mLastDriverRoamAttempt = 0; - mWifiInjector.getWifiLastResortWatchdog().connectedStateTransition(false, - getTargetSsid()); + mWifiInjector.getWifiLastResortWatchdog().connectedStateTransition(false); } } |