From 3d8cdb10f6103a794e4cb68adb5de03a325d1c8f Mon Sep 17 00:00:00 2001 From: Samuel Tan Date: Wed, 3 Feb 2016 13:21:57 -0800 Subject: [PATCH] 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. --- src/com/android/settings/wifi/WifiConfigController.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/com/android/settings/wifi/WifiConfigController.java b/src/com/android/settings/wifi/WifiConfigController.java index d108af4125f..4145a083440 100644 --- a/src/com/android/settings/wifi/WifiConfigController.java +++ b/src/com/android/settings/wifi/WifiConfigController.java @@ -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 {