Correctly load saved EAP CA cert and user cert options

Previously, we did not properly load the "Do not validate"
and "Do not provide" options for the CA certificate and
User certificate EAP network configuration fields respectively
when the user previously selected these options and saved the
configuration.

Fix this by properly checking the saved CA certificate and user
certificate aliases in the saved enterprise config.

BUG: 26686071
Change-Id: If180c611f7210718cfb11c0578545b6f027827b5
TEST: Saved EAP network with the abovementioned options.
TEST: Long-pressed saved network on Wifi menu and selected "Modify Network"
TEST: "Do not validate" and "Do not provide" options are re-loaded.
This commit is contained in:
Samuel Tan
2016-02-03 13:21:57 -08:00
parent d2846524a0
commit 3d8cdb10f6

View File

@@ -765,7 +765,7 @@ public class WifiConfigController
}
String[] caCerts = enterpriseConfig.getCaCertificateAliases();
if (caCerts == null) {
setSelection(mEapCaCertSpinner, mUnspecifiedCertString);
setSelection(mEapCaCertSpinner, mDoNotValidateEapServerString);
} else if (caCerts.length == 1) {
setSelection(mEapCaCertSpinner, caCerts[0]);
} else {
@@ -775,7 +775,12 @@ public class WifiConfigController
mEapCaCertSpinner.setSelection(MULTIPLE_CERT_SET_INDEX);
}
mEapDomainView.setText(enterpriseConfig.getDomainSuffixMatch());
setSelection(mEapUserCertSpinner, enterpriseConfig.getClientCertificateAlias());
String userCert = enterpriseConfig.getClientCertificateAlias();
if (TextUtils.isEmpty(userCert)) {
setSelection(mEapUserCertSpinner, mDoNotProvideEapUserCertString);
} else {
setSelection(mEapUserCertSpinner, userCert);
}
mEapIdentityView.setText(enterpriseConfig.getIdentity());
mEapAnonymousView.setText(enterpriseConfig.getAnonymousIdentity());
} else {