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

Commit 2066b9ca authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Add content description for password&pin credential view." into main

parents 77a1850f 1e5805d3
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 {