Fixed accessibility issues in Wi-Fi password view for SUW

- Keep the Save button enabled at all times

- Show "*required" or "The password is invalid" to remind the user

Bug: 386897596
Flag: EXEMPT bugfix
Test: Manual testing
  atest WifiConfigControllerTest
Change-Id: I442d2f958efd85f3c92309d0bed7cd3aa9ec9876
This commit is contained in:
Weng Su
2025-03-12 20:46:49 +08:00
parent 9066ecf68a
commit 351e6a94e0
9 changed files with 146 additions and 103 deletions

View File

@@ -21,14 +21,10 @@ import androidx.appcompat.app.AlertDialog
class WifiDialogHelper(
alertDialog: AlertDialog,
private val ssidInputGroup: TextInputGroup? = null,
private val validator: TextInputValidator,
) : AlertDialogHelper(alertDialog) {
override fun canDismiss(): Boolean {
val isValid = ssidInputGroup?.validate() ?: true
if (!isValid) Log.w(TAG, "SSID is invalid!")
return isValid
}
override fun canDismiss(): Boolean = validator.validate()
companion object {
const val TAG = "WifiDialogHelper"