am a5b7b45b: Push down the supplicant-specific double-quote handling to framework.

Merge commit 'a5b7b45b6fe125b5f04d248b0f624eee9a7ea7da' into eclair-mr2-plus-aosp

* commit 'a5b7b45b6fe125b5f04d248b0f624eee9a7ea7da':
  Push down the supplicant-specific double-quote handling to framework.
This commit is contained in:
Chung-yih Wang
2009-10-12 18:41:08 -07:00
committed by Android Git Automerger
2 changed files with 14 additions and 22 deletions

View File

@@ -166,12 +166,6 @@ public final class AccessPointState implements Comparable<AccessPointState>, Par
if (TextUtils.isEmpty(string)) {
return "";
}
final int lastPos = string.length() - 1;
if (lastPos < 0 || (string.charAt(0) == '"' && string.charAt(lastPos) == '"')) {
return string;
}
return "\"" + string + "\"";
}
@@ -225,7 +219,7 @@ public final class AccessPointState implements Comparable<AccessPointState>, Par
public void setSsid(String ssid) {
if (ssid != null) {
this.ssid = convertToQuotedString(ssid);
this.ssid = ssid;
requestRefresh();
}
}
@@ -478,41 +472,40 @@ public final class AccessPointState implements Comparable<AccessPointState>, Par
config.BSSID = getWpaSupplicantBssid();
config.priority = priority;
config.hiddenSSID = hiddenSsid;
config.SSID = convertToQuotedString(ssid);
config.SSID = ssid;
config.eap.setValue(mEap);
if (!TextUtils.isEmpty(mPhase2)) {
config.phase2.setValue(convertToQuotedString("auth=" + mPhase2));
config.phase2.setValue("auth=" + mPhase2);
} else {
config.phase2.setValue(null);
}
if (!TextUtils.isEmpty(mEnterpriseFields[IDENTITY])) {
config.identity.setValue(
convertToQuotedString(mEnterpriseFields[IDENTITY]));
config.identity.setValue(mEnterpriseFields[IDENTITY]);
} else {
config.identity.setValue(null);
}
if (!TextUtils.isEmpty(mEnterpriseFields[ANONYMOUS_IDENTITY])) {
config.anonymous_identity.setValue(convertToQuotedString(
mEnterpriseFields[ANONYMOUS_IDENTITY]));
config.anonymous_identity.setValue(
mEnterpriseFields[ANONYMOUS_IDENTITY]);
} else {
config.anonymous_identity.setValue(null);
}
if (!TextUtils.isEmpty(mEnterpriseFields[CLIENT_CERT])) {
config.client_cert.setValue(convertToQuotedString(
mEnterpriseFields[CLIENT_CERT]));
config.client_cert.setValue(
mEnterpriseFields[CLIENT_CERT]);
} else {
config.client_cert.setValue(null);
}
if (!TextUtils.isEmpty(mEnterpriseFields[CA_CERT])) {
config.ca_cert.setValue(convertToQuotedString(
mEnterpriseFields[CA_CERT]));
config.ca_cert.setValue(
mEnterpriseFields[CA_CERT]);
} else {
config.ca_cert.setValue(null);
}
if (!TextUtils.isEmpty(mEnterpriseFields[PRIVATE_KEY])) {
config.private_key.setValue(convertToQuotedString(
mEnterpriseFields[PRIVATE_KEY]));
config.private_key.setValue(
mEnterpriseFields[PRIVATE_KEY]);
} else {
config.private_key.setValue(null);
}
@@ -565,7 +558,7 @@ public final class AccessPointState implements Comparable<AccessPointState>, Par
config.allowedKeyManagement.set(KeyMgmt.WPA_EAP);
config.allowedKeyManagement.set(KeyMgmt.IEEE8021X);
if (!TextUtils.isEmpty(mPassword)) {
config.password.setValue(convertToQuotedString(mPassword));
config.password.setValue(mPassword);
}
} else if (security.equals(OPEN)) {
config.allowedKeyManagement.set(KeyMgmt.NONE);

View File

@@ -749,7 +749,6 @@ public class WifiLayer {
// We already know about this one
continue;
}
ap = new AccessPointState(mContext);
ap.updateFromWifiConfiguration(config);
if (LOGV) Log.v(TAG, "Created " + ap + " in loadConfiguredAccessPoints");
@@ -1152,7 +1151,7 @@ public class WifiLayer {
continue;
}
final String ssid = AccessPointState.convertToQuotedString(scanResult.SSID);
final String ssid = scanResult.SSID;
String security = AccessPointState.getScanResultSecurity(scanResult);
// See if this AP is part of a group of APs (e.g., any large