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

Commit 1343fd11 authored by Arpan's avatar Arpan
Browse files

BioPasskeys UI Bugfix to use DisplayName

The get flow was generated with a 'username' bit to account for general
flows, but the passkey flow needs to condition to use displayname where
possible. That conditioning needs to also be done in the biometric
handler when the credential entry is being read.

Bug: 333445772
Test: E2E AndroidVault Test
Flag: EXEMPT bugfix
Change-Id: I6036ef8581cfc573528e4bbe42b3d5e728db365b
parent fda0d93b
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -34,6 +34,7 @@ import com.android.credentialmanager.getflow.ProviderDisplayInfo
import com.android.credentialmanager.getflow.RequestDisplayInfo
import com.android.credentialmanager.getflow.generateDisplayTitleTextResCode
import com.android.credentialmanager.model.BiometricRequestInfo
import com.android.credentialmanager.model.CredentialType
import com.android.credentialmanager.model.EntryInfo
import com.android.credentialmanager.model.creation.CreateOptionInfo
import com.android.credentialmanager.model.get.CredentialEntryInfo
@@ -476,7 +477,9 @@ private fun retrieveBiometricGetDisplayValues(
        return null
    }
    val singleEntryType = selectedEntry.credentialType
    val username = selectedEntry.userName
    val descriptionName = if (singleEntryType == CredentialType.PASSKEY &&
        !selectedEntry.displayName.isNullOrBlank()) selectedEntry.displayName else
        selectedEntry.userName

    // TODO(b/336362538) : In W, utilize updated localization strings
    displayTitleText = context.getString(
@@ -487,7 +490,7 @@ private fun retrieveBiometricGetDisplayValues(
    descriptionText = context.getString(
        R.string.get_dialog_description_single_tap,
        getRequestDisplayInfo.appName,
        username
        descriptionName
    )

    return BiometricDisplayInfo(providerIcon = icon, providerName = providerName,