Display warning if users does not provide CA cert in EAP config

Display an explicit warning in the WiFi configuration menu if
the user selects the option to not validate the EAP server (i.e.
does not provide a CA certificate) in an EAP configuration.

BUG: 26686071
Change-Id: I73620b60defdcf40865f8c67d5de24b5dad636f8
TEST: Warning appears when the abovementioned option is selected.
This commit is contained in:
Samuel Tan
2016-01-21 18:17:17 -08:00
parent f827c929dd
commit 57c329c9f9
4 changed files with 35 additions and 0 deletions

View File

@@ -409,6 +409,18 @@ public class WifiConfigController implements TextWatcher,
return enabled;
}
void showWarningMessageIfAppropriate() {
mView.findViewById(R.id.no_ca_cert_warning).setVisibility(View.GONE);
if (mEapCaCertSpinner != null
&& mView.findViewById(R.id.l_ca_cert).getVisibility() != View.GONE
&& ((String) mEapCaCertSpinner.getSelectedItem())
.equals(mDoNotValidateEapServerString)) {
// Display warning if user chooses not to validate the EAP server with a user-supplied
// CA certificate in an EAP network configuration.
mView.findViewById(R.id.no_ca_cert_warning).setVisibility(View.VISIBLE);
}
}
/* package */ WifiConfiguration getConfig() {
if (mMode == WifiConfigUiBase.MODE_VIEW) {
return null;
@@ -1115,6 +1127,7 @@ public class WifiConfigController implements TextWatcher,
} else {
showIpConfigFields();
}
showWarningMessageIfAppropriate();
enableSubmitIfAppropriate();
}