Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1e5805d3 authored by Hao Dong's avatar Hao Dong
Browse files

Add content description for password&pin credential view.

Bug: 384635437
Test: manual test with talkback on on test app
Flag: EXEMPT for a11y bug fix
Change-Id: If85114ad9153f20f70808c01325fb1e119afbf26
parent a808c906
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -43,6 +43,9 @@ object CredentialPasswordViewBinder {
            // the header info never changes - do it early
            val header = viewModel.header.first()
            passwordField.setTextOperationUser(UserHandle.of(header.user.userIdForPasswordEntry))
            viewModel.inputBoxContentDescription.firstOrNull()?.let { descriptionId ->
                passwordField.contentDescription = view.context.getString(descriptionId)
            }
            viewModel.inputFlags.firstOrNull()?.let { flags -> passwordField.inputType = flags }
            if (requestFocusForInput) {
                passwordField.requestFocus()
+11 −0
Original line number Diff line number Diff line
@@ -59,6 +59,17 @@ constructor(
            }
        }

    /** Input box accessibility description for text based credential views */
    val inputBoxContentDescription: Flow<Int?> =
        credentialInteractor.prompt.map {
            when (it) {
                is BiometricPromptRequest.Credential.Pin -> R.string.keyguard_accessibility_pin_area
                is BiometricPromptRequest.Credential.Password ->
                    R.string.keyguard_accessibility_password
                else -> null
            }
        }

    /** If stealth mode is active (hide user credential input). */
    val stealthMode: Flow<Boolean> =
        credentialInteractor.prompt.map {