Still check the visibility of view

Since EAP has many sub type, which controls differnet view. We still need to check the
visibility to determine which type it is.

Bug: 116767176
Test: RunSettingsRoboTests
Change-Id: Iee04a50140ae1afacdf77eedf7743a465bae1f58
This commit is contained in:
jackqdyulei
2018-09-27 16:24:21 -07:00
parent 092f66b279
commit e95f07dff6
2 changed files with 21 additions and 5 deletions

View File

@@ -123,7 +123,8 @@ public class WifiConfigController implements TextWatcher,
private final ArrayAdapter<String> mPhase2FullAdapter;
// e.g. AccessPoint.SECURITY_NONE
private int mAccessPointSecurity;
@VisibleForTesting
int mAccessPointSecurity;
private TextView mPasswordView;
private String mUnspecifiedCertString;
@@ -465,7 +466,8 @@ public class WifiConfigController implements TextWatcher,
} else {
enabled = ipAndProxyFieldsAreValid();
}
if (mAccessPointSecurity == AccessPoint.SECURITY_EAP) {
if (mAccessPointSecurity == AccessPoint.SECURITY_EAP && mEapCaCertSpinner != null
&& mView.findViewById(R.id.l_ca_cert).getVisibility() != View.GONE) {
String caCertSelection = (String) mEapCaCertSpinner.getSelectedItem();
if (caCertSelection.equals(mUnspecifiedCertString)) {
// Disallow submit if the user has not selected a CA certificate for an EAP network
@@ -481,7 +483,8 @@ public class WifiConfigController implements TextWatcher,
enabled = false;
}
}
if (mAccessPointSecurity == AccessPoint.SECURITY_EAP
if (mAccessPointSecurity == AccessPoint.SECURITY_EAP && mEapUserCertSpinner != null
&& mView.findViewById(R.id.l_user_cert).getVisibility() != View.GONE
&& mEapUserCertSpinner.getSelectedItem().equals(mUnspecifiedCertString)) {
// Disallow submit if the user has not selected a user certificate for an EAP network
// configuration.