Move some wifi tracking code to SettingsLib

Move tracking of which networks are available/saved and their state
over to SettingsLib to share it with Quick Settings.

Bug: 19180466
Change-Id: Iaeef06b26da8cb38e1ba09a7d105d04d499dc181
This commit is contained in:
Jason Monk
2015-01-28 10:35:53 -05:00
parent 544714d0ea
commit fc1b00cfe4
17 changed files with 302 additions and 1270 deletions

View File

@@ -45,6 +45,7 @@ import android.widget.ProgressBar;
import android.widget.TextView;
import com.android.settings.R;
import com.android.settingslib.wifi.AccessPoint;
import java.io.IOException;
@@ -121,7 +122,7 @@ class WriteWifiConfigToNfcDialog extends AlertDialog
String password = mPasswordView.getText().toString();
String wpsNfcConfigurationToken
= mWifiManager.getWpsNfcConfigurationToken(mAccessPoint.networkId);
= mWifiManager.getWpsNfcConfigurationToken(mAccessPoint.getConfig().networkId);
String passwordHex = byteArrayToHexString(password.getBytes());
String passwordLength = password.length() >= HEX_RADIX
@@ -224,9 +225,9 @@ class WriteWifiConfigToNfcDialog extends AlertDialog
private void enableSubmitIfAppropriate() {
if (mPasswordView != null) {
if (mAccessPoint.security == AccessPoint.SECURITY_WEP) {
if (mAccessPoint.getSecurity() == AccessPoint.SECURITY_WEP) {
mSubmitButton.setEnabled(mPasswordView.length() > 0);
} else if (mAccessPoint.security == AccessPoint.SECURITY_PSK) {
} else if (mAccessPoint.getSecurity() == AccessPoint.SECURITY_PSK) {
mSubmitButton.setEnabled(mPasswordView.length() >= 8);
}
} else {