Loading src/com/android/settings/wifi/WifiConfigController.java +3 −6 Original line number Diff line number Diff line Loading @@ -465,8 +465,7 @@ public class WifiConfigController implements TextWatcher, } else { enabled = ipAndProxyFieldsAreValid(); } if (mEapCaCertSpinner != null && mView.findViewById(R.id.l_ca_cert).getVisibility() != View.GONE) { if (mAccessPointSecurity == AccessPoint.SECURITY_EAP) { String caCertSelection = (String) mEapCaCertSpinner.getSelectedItem(); if (caCertSelection.equals(mUnspecifiedCertString)) { // Disallow submit if the user has not selected a CA certificate for an EAP network Loading @@ -482,10 +481,8 @@ public class WifiConfigController implements TextWatcher, enabled = false; } } if (mEapUserCertSpinner != null && mView.findViewById(R.id.l_user_cert).getVisibility() != View.GONE && ((String) mEapUserCertSpinner.getSelectedItem()) .equals(mUnspecifiedCertString)) { if (mAccessPointSecurity == AccessPoint.SECURITY_EAP && mEapUserCertSpinner.getSelectedItem().equals(mUnspecifiedCertString)) { // Disallow submit if the user has not selected a user certificate for an EAP network // configuration. enabled = false; Loading tests/robotests/src/com/android/settings/wifi/WifiConfigControllerTest.java +16 −0 Original line number Diff line number Diff line Loading @@ -183,6 +183,22 @@ public class WifiConfigControllerTest { mController.isSubmittable(); } @Test public void isSubmittable_EapToPskWithValidPassword_shouldReturnTrue() { final TextView password = mView.findViewById(R.id.password); final Spinner securitySpinner = mView.findViewById(R.id.security); assertThat(password).isNotNull(); assertThat(securitySpinner).isNotNull(); when(mAccessPoint.isSaved()).thenReturn(true); // Change it from EAP to PSK mController.onItemSelected(securitySpinner, null, AccessPoint.SECURITY_EAP, 0); mController.onItemSelected(securitySpinner, null, AccessPoint.SECURITY_PSK, 0); password.setText(GOOD_PSK); assertThat(mController.isSubmittable()).isTrue(); } @Test public void getSignalString_notReachable_shouldHaveNoSignalString() { when(mAccessPoint.isReachable()).thenReturn(false); Loading Loading
src/com/android/settings/wifi/WifiConfigController.java +3 −6 Original line number Diff line number Diff line Loading @@ -465,8 +465,7 @@ public class WifiConfigController implements TextWatcher, } else { enabled = ipAndProxyFieldsAreValid(); } if (mEapCaCertSpinner != null && mView.findViewById(R.id.l_ca_cert).getVisibility() != View.GONE) { if (mAccessPointSecurity == AccessPoint.SECURITY_EAP) { String caCertSelection = (String) mEapCaCertSpinner.getSelectedItem(); if (caCertSelection.equals(mUnspecifiedCertString)) { // Disallow submit if the user has not selected a CA certificate for an EAP network Loading @@ -482,10 +481,8 @@ public class WifiConfigController implements TextWatcher, enabled = false; } } if (mEapUserCertSpinner != null && mView.findViewById(R.id.l_user_cert).getVisibility() != View.GONE && ((String) mEapUserCertSpinner.getSelectedItem()) .equals(mUnspecifiedCertString)) { if (mAccessPointSecurity == AccessPoint.SECURITY_EAP && mEapUserCertSpinner.getSelectedItem().equals(mUnspecifiedCertString)) { // Disallow submit if the user has not selected a user certificate for an EAP network // configuration. enabled = false; Loading
tests/robotests/src/com/android/settings/wifi/WifiConfigControllerTest.java +16 −0 Original line number Diff line number Diff line Loading @@ -183,6 +183,22 @@ public class WifiConfigControllerTest { mController.isSubmittable(); } @Test public void isSubmittable_EapToPskWithValidPassword_shouldReturnTrue() { final TextView password = mView.findViewById(R.id.password); final Spinner securitySpinner = mView.findViewById(R.id.security); assertThat(password).isNotNull(); assertThat(securitySpinner).isNotNull(); when(mAccessPoint.isSaved()).thenReturn(true); // Change it from EAP to PSK mController.onItemSelected(securitySpinner, null, AccessPoint.SECURITY_EAP, 0); mController.onItemSelected(securitySpinner, null, AccessPoint.SECURITY_PSK, 0); password.setText(GOOD_PSK); assertThat(mController.isSubmittable()).isTrue(); } @Test public void getSignalString_notReachable_shouldHaveNoSignalString() { when(mAccessPoint.isReachable()).thenReturn(false); Loading