Merge "Fix submit button display for WPS" into honeycomb-LTE

This commit is contained in:
Irfan Sheriff
2011-05-23 16:46:22 -07:00
committed by Android (Google) Code Review

View File

@@ -265,10 +265,18 @@ public class WifiConfigController implements TextWatcher,
if (submit == null) return; if (submit == null) return;
boolean enabled = false; boolean enabled = false;
boolean passwordInvalid = false;
/* Check password invalidity for manual network set up alone */
if (chosenNetworkSetupMethod() == MANUAL &&
((mAccessPointSecurity == AccessPoint.SECURITY_WEP && mPasswordView.length() == 0) ||
(mAccessPointSecurity == AccessPoint.SECURITY_PSK && mPasswordView.length() < 8))) {
passwordInvalid = true;
}
if ((mSsidView != null && mSsidView.length() == 0) || if ((mSsidView != null && mSsidView.length() == 0) ||
((mAccessPoint == null || mAccessPoint.networkId == INVALID_NETWORK_ID) && ((mAccessPoint == null || mAccessPoint.networkId == INVALID_NETWORK_ID) &&
((mAccessPointSecurity == AccessPoint.SECURITY_WEP && mPasswordView.length() == 0) || passwordInvalid)) {
(mAccessPointSecurity == AccessPoint.SECURITY_PSK && mPasswordView.length() < 8)))) {
enabled = false; enabled = false;
} else { } else {
if (ipAndProxyFieldsAreValid()) { if (ipAndProxyFieldsAreValid()) {
@@ -729,16 +737,14 @@ public class WifiConfigController implements TextWatcher,
if (parent == mSecuritySpinner) { if (parent == mSecuritySpinner) {
mAccessPointSecurity = position; mAccessPointSecurity = position;
showSecurityFields(); showSecurityFields();
enableSubmitIfAppropriate();
} else if (parent == mNetworkSetupSpinner) { } else if (parent == mNetworkSetupSpinner) {
showNetworkSetupFields(); showNetworkSetupFields();
} else if (parent == mProxySettingsSpinner) { } else if (parent == mProxySettingsSpinner) {
showProxyFields(); showProxyFields();
enableSubmitIfAppropriate();
} else { } else {
showIpConfigFields(); showIpConfigFields();
enableSubmitIfAppropriate();
} }
enableSubmitIfAppropriate();
} }
@Override @Override