Merge "Add support for wifi verification before connect"

This commit is contained in:
Irfan Sheriff
2012-02-29 19:35:17 -08:00
committed by Android (Google) Code Review
3 changed files with 14 additions and 8 deletions

View File

@@ -237,6 +237,10 @@
<item>Disconnected</item> <item>Disconnected</item>
<!-- Status message of Wi-Fi when it is a failure. --> <!-- Status message of Wi-Fi when it is a failure. -->
<item>Unsuccessful</item> <item>Unsuccessful</item>
<!-- Status message of Wi-Fi when it is blocked. -->
<item>Blocked</item>
<!-- Status message of Wi-Fi when connectiong is being verified. -->
<item>Temporarily avoiding poor connection</item>
</string-array> </string-array>
<!-- Match this with the order of NetworkInfo.DetailedState. --> <skip /> <!-- Match this with the order of NetworkInfo.DetailedState. --> <skip />
@@ -262,6 +266,10 @@
<item>Disconnected</item> <item>Disconnected</item>
<!-- Status message of Wi-Fi when it is a failure. --> <!-- Status message of Wi-Fi when it is a failure. -->
<item>Unsuccessful</item> <item>Unsuccessful</item>
<!-- Status message of Wi-Fi when it is blocked. -->
<item>Blocked</item>
<!-- Status message of Wi-Fi when connectiong is being verified. -->
<item>Temporarily avoiding poor connection</item>
</string-array> </string-array>
<!-- Match this with the constants in AccessPoint. --> <skip /> <!-- Match this with the constants in AccessPoint. --> <skip />

View File

@@ -77,10 +77,7 @@ public class AdvancedWifiSettings extends SettingsPreferenceFragment
(CheckBoxPreference) findPreference(KEY_ENABLE_WIFI_WATCHDOG); (CheckBoxPreference) findPreference(KEY_ENABLE_WIFI_WATCHDOG);
if (watchdogEnabled != null) { if (watchdogEnabled != null) {
watchdogEnabled.setChecked(Secure.getInt(getContentResolver(), watchdogEnabled.setChecked(Secure.getInt(getContentResolver(),
Secure.WIFI_WATCHDOG_ON, 1) == 1); Secure.WIFI_WATCHDOG_POOR_NETWORK_TEST_ENABLED, 1) == 1);
//TODO: Bring this back after changing watchdog behavior
getPreferenceScreen().removePreference(watchdogEnabled);
} }
ListPreference frequencyPref = (ListPreference) findPreference(KEY_FREQUENCY_BAND); ListPreference frequencyPref = (ListPreference) findPreference(KEY_FREQUENCY_BAND);
@@ -145,7 +142,7 @@ public class AdvancedWifiSettings extends SettingsPreferenceFragment
((CheckBoxPreference) preference).isChecked() ? 1 : 0); ((CheckBoxPreference) preference).isChecked() ? 1 : 0);
} else if (KEY_ENABLE_WIFI_WATCHDOG.equals(key)) { } else if (KEY_ENABLE_WIFI_WATCHDOG.equals(key)) {
Secure.putInt(getContentResolver(), Secure.putInt(getContentResolver(),
Secure.WIFI_WATCHDOG_ON, Secure.WIFI_WATCHDOG_POOR_NETWORK_TEST_ENABLED,
((CheckBoxPreference) preference).isChecked() ? 1 : 0); ((CheckBoxPreference) preference).isChecked() ? 1 : 0);
} else { } else {
return super.onPreferenceTreeClick(screen, preference); return super.onPreferenceTreeClick(screen, preference);

View File

@@ -565,9 +565,10 @@ public class WifiSettings extends SettingsPreferenceFragment
//network state change events so the apps dont have to worry about //network state change events so the apps dont have to worry about
//ignoring supplicant state change when network is connected //ignoring supplicant state change when network is connected
//to get more fine grained information. //to get more fine grained information.
if (!mConnected.get()) { SupplicantState state = (SupplicantState) intent.getParcelableExtra(
updateConnectionState(WifiInfo.getDetailedStateOf((SupplicantState) WifiManager.EXTRA_NEW_STATE);
intent.getParcelableExtra(WifiManager.EXTRA_NEW_STATE))); if (!mConnected.get() && SupplicantState.isHandshakeState(state)) {
updateConnectionState(WifiInfo.getDetailedStateOf(state));
} }
if (mInXlSetupWizard) { if (mInXlSetupWizard) {