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

@@ -28,6 +28,7 @@ import android.widget.TextView
import androidx.annotation.OpenForTesting
import androidx.appcompat.app.AlertDialog
import com.android.settings.R
import com.android.settings.wifi.utils.WifiDialogHelper
import com.android.settingslib.RestrictedLockUtils
import com.android.settingslib.RestrictedLockUtilsInternal
import com.android.wifitrackerlib.WifiEntry
@@ -68,6 +69,7 @@ open class WifiDialog2 @JvmOverloads constructor(
private lateinit var view: View
private lateinit var controller: WifiConfigController2
private lateinit var dialogHelper: WifiDialogHelper
override fun getController(): WifiConfigController2 = controller
@@ -89,6 +91,7 @@ open class WifiDialog2 @JvmOverloads constructor(
if (wifiEntry == null) {
controller.hideForgetButton()
}
dialogHelper = WifiDialogHelper(this, this, controller.validator)
}
private fun setWindowsOverlay() {