summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Arpan <akaphle@google.com> 2024-06-13 21:42:51 +0000
committer Arpan <akaphle@google.com> 2024-06-13 22:29:24 +0000
commit1343fd116b5cb14bd92c1b8f0e993a6ed90d29f5 (patch)
tree222fd47f4697cb84bb375cfefaacab37317467f0
parentfda0d93bafad8eef575efcb5308ba7ebded4afee (diff)
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
-rw-r--r--packages/CredentialManager/src/com/android/credentialmanager/common/BiometricHandler.kt7
1 files changed, 5 insertions, 2 deletions
diff --git a/packages/CredentialManager/src/com/android/credentialmanager/common/BiometricHandler.kt b/packages/CredentialManager/src/com/android/credentialmanager/common/BiometricHandler.kt
index c35721c11741..772e02eb9e29 100644
--- a/packages/CredentialManager/src/com/android/credentialmanager/common/BiometricHandler.kt
+++ b/packages/CredentialManager/src/com/android/credentialmanager/common/BiometricHandler.kt
@@ -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,