Fixed accessibility issues in Wi-Fi password view in Settings

- Keep the Save button enabled at all times

- Show "*required" or "The password is invalid" to remind the user
  - Show "Password (optional)" to indicate that it can remain unchanged, when modifying Wi-Fi configuration

Bug: 386897596
Bug: 402694144
Flag: EXEMPT bugfix
Test: Manual testing
  atest SettingsUnitTests:AddNetworkFragmentTest
  atest WifiConfigControllerTest \
        WifiConfigController2Test \
        WifiDialogActivityTest
Change-Id: I09b7684674ff376139565fcc196cde8d8d20a864
This commit is contained in:
Weng Su
2025-03-14 18:33:18 +08:00
parent cec2696f62
commit 040e2a867a
14 changed files with 54 additions and 142 deletions

View File

@@ -118,7 +118,7 @@ public class WifiDialog extends AlertDialog implements WifiConfigUiBase,
mController.hideForgetButton();
}
mDialogHelper = new WifiDialogHelper(this, mController.getValidator());
mDialogHelper = new WifiDialogHelper(this, this, mController.getValidator());
}
@SuppressWarnings("MissingSuperCall") // TODO: Fix me
@@ -159,6 +159,9 @@ public class WifiDialog extends AlertDialog implements WifiConfigUiBase,
public void onClick(DialogInterface dialogInterface, int id) {
if (mListener != null) {
switch (id) {
case BUTTON_SUBMIT:
mListener.onSubmit(this);
break;
case BUTTON_FORGET:
if (WifiUtils.isNetworkLockedDown(getContext(), mAccessPoint.getConfig())) {
RestrictedLockUtils.sendShowAdminSupportDetailsIntent(getContext(),
@@ -171,11 +174,6 @@ public class WifiDialog extends AlertDialog implements WifiConfigUiBase,
}
}
/** Return true to tell the parent activity to call onSubmit before onDismiss. */
public boolean shouldSubmitBeforeFinish() {
return mDialogHelper.isPositive();
}
@Override
public int getMode() {
return mMode;