diff options
author | Irfan Sheriff <isheriff@google.com> | 2010-04-16 14:56:54 -0700 |
---|---|---|
committer | Irfan Sheriff <isheriff@google.com> | 2010-04-16 14:56:54 -0700 |
commit | e81497095bd97a14db07d870cb9f57aa0c220078 (patch) | |
tree | 3eac9770ce20977d02eb1c93aceed8904573661a /src | |
parent | c02a09aa565318f37d9481d05d50610fe722e4b4 (diff) | |
download | packages_apps_Settings-e81497095bd97a14db07d870cb9f57aa0c220078.zip packages_apps_Settings-e81497095bd97a14db07d870cb9f57aa0c220078.tar.gz packages_apps_Settings-e81497095bd97a14db07d870cb9f57aa0c220078.tar.bz2 |
Stop scanning after errors
When scan fails for 3 times, we show a
failure toast and continue to scan.
In one case this caused infinite toasts,
until the user stopped wifi.
Its not clear what can cause this kind of
a state since wifi disable broadcast should
stop the scans. This fix will stop scans
after 3 continuous failures. Any wifi state
change will restart scan.
Bug: 2601937
Change-Id: I68733394cb3c9b76ffb15f7579e7af6c1f54d39c
Diffstat (limited to 'src')
-rw-r--r-- | src/com/android/settings/wifi/WifiSettings.java | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/com/android/settings/wifi/WifiSettings.java b/src/com/android/settings/wifi/WifiSettings.java index 0965854..2eca1d7 100644 --- a/src/com/android/settings/wifi/WifiSettings.java +++ b/src/com/android/settings/wifi/WifiSettings.java @@ -431,8 +431,10 @@ public class WifiSettings extends PreferenceActivity implements DialogInterface. private void updateConnectionState(DetailedState state) { /* sticky broadcasts can call this when wifi is disabled */ - if (!mWifiManager.isWifiEnabled()) + if (!mWifiManager.isWifiEnabled()) { + mScanner.pause(); return; + } if (state == DetailedState.OBTAINING_IPADDR) { mScanner.pause(); @@ -489,6 +491,7 @@ public class WifiSettings extends PreferenceActivity implements DialogInterface. mRetry = 0; Toast.makeText(WifiSettings.this, R.string.wifi_fail_to_scan, Toast.LENGTH_LONG).show(); + return; } mAccessPoints.setProgress(mRetry != 0); sendEmptyMessageDelayed(0, 6000); |