diff options
author | Rebecca Silberstein <silberst@google.com> | 2016-04-29 16:10:45 -0700 |
---|---|---|
committer | Rebecca Silberstein <silberst@google.com> | 2016-04-29 16:33:28 -0700 |
commit | 91a8893f047b8a193e4516ab772b6f43882777f5 (patch) | |
tree | 9c7a67c2171a17ea32a2e77aa4a5fb2d775658b0 /service/java/com/android/server/wifi/WifiLastResortWatchdog.java | |
parent | ddf3afe31f5e2174643e41943e9e9b881033981a (diff) | |
download | android_frameworks_opt_net_wifi-91a8893f047b8a193e4516ab772b6f43882777f5.tar.gz android_frameworks_opt_net_wifi-91a8893f047b8a193e4516ab772b6f43882777f5.tar.bz2 android_frameworks_opt_net_wifi-91a8893f047b8a193e4516ab772b6f43882777f5.zip |
WifiLastResortWatchdog: update config if not null
When new scan results are processed, networks already stored as the
available networks may have updated configs passed in, but they may also
have null configs. The null configs should not be used to update the
stored config. Added a check to determine if the passed in config is
not null before the update.
In addition, debugging output also reported the value of
HasEverConnected as false for networks with a null config. This was
updated to report null_config instead.
Added tests covering config updates.
Added tests for debugging output.
BUG: 28451079
Change-Id: Iff9888ab87c61619b2f865516eca22d87eb4f4b8
Diffstat (limited to 'service/java/com/android/server/wifi/WifiLastResortWatchdog.java')
-rw-r--r-- | service/java/com/android/server/wifi/WifiLastResortWatchdog.java | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/service/java/com/android/server/wifi/WifiLastResortWatchdog.java b/service/java/com/android/server/wifi/WifiLastResortWatchdog.java index a953404c5..896c1c816 100644 --- a/service/java/com/android/server/wifi/WifiLastResortWatchdog.java +++ b/service/java/com/android/server/wifi/WifiLastResortWatchdog.java @@ -128,8 +128,10 @@ public class WifiLastResortWatchdog { } mSsidFailureCount.put(ssid, ssidFailsAndApCount); } - // refresh config - availableNetworkFailureCount.config = config; + // refresh config if it is not null + if (config != null) { + availableNetworkFailureCount.config = config; + } // If we saw a network, set its Age to -1 here, aging iteration will set it to 0 availableNetworkFailureCount.age = -1; mRecentAvailableNetworks.put(bssid, availableNetworkFailureCount); @@ -185,6 +187,7 @@ public class WifiLastResortWatchdog { // Have we met conditions to trigger the Watchdog Wifi restart? boolean isRestartNeeded = checkTriggerCondition(); + if (VDBG) Log.v(TAG, "isRestartNeeded = " + isRestartNeeded); if (isRestartNeeded) { // Stop the watchdog from triggering until re-enabled setWatchdogTriggerEnabled(false); @@ -292,7 +295,7 @@ public class WifiLastResortWatchdog { * @return is the trigger condition true */ private boolean checkTriggerCondition() { - if (VDBG) Log.v(TAG, "checkTriggerCondition:"); + if (VDBG) Log.v(TAG, "checkTriggerCondition."); // Don't check Watchdog trigger if wifi is in a connected state // (This should not occur, but we want to protect against any race conditions) if (mWifiIsConnected) return false; @@ -492,8 +495,8 @@ public class WifiLastResortWatchdog { */ public int age = 0; - AvailableNetworkFailureCount(WifiConfiguration config) { - config = config; + AvailableNetworkFailureCount(WifiConfiguration configParam) { + this.config = configParam; } /** @@ -525,7 +528,7 @@ public class WifiLastResortWatchdog { public String toString() { return ssid + ", HasEverConnected: " + ((config != null) - ? config.getNetworkSelectionStatus().getHasEverConnected() : false) + ? config.getNetworkSelectionStatus().getHasEverConnected() : "null_config") + ", Failures: {" + "Assoc: " + associationRejection + ", Auth: " + authenticationFailure |