Loading packages/CredentialManager/src/com/android/credentialmanager/DataConverter.kt +3 −10 Original line number Diff line number Diff line Loading @@ -252,13 +252,6 @@ class GetFlowUtils { )) } is PublicKeyCredentialEntry -> { val passkeyUsername = credentialEntry.username.toString() val passkeyDisplayName = credentialEntry.displayName?.toString() ?: "" val (username, displayName) = userAndDisplayNameForPasskey( passkeyUsername = passkeyUsername, passkeyDisplayName = passkeyDisplayName, ) result.add(CredentialEntryInfo( providerId = providerId, providerDisplayName = providerLabel, Loading @@ -268,8 +261,8 @@ class GetFlowUtils { fillInIntent = it.frameworkExtrasIntent, credentialType = CredentialType.PASSKEY, credentialTypeDisplayName = credentialEntry.typeDisplayName.toString(), userName = username, displayName = displayName, userName = credentialEntry.username.toString(), displayName = credentialEntry.displayName?.toString(), icon = credentialEntry.icon.loadDrawable(context), shouldTintIcon = credentialEntry.isDefaultIcon, lastUsedTimeMillis = credentialEntry.lastUsedTime, Loading Loading @@ -707,7 +700,7 @@ class CreateFlowUtils { * 2) username on top if display-name is not available. * 3) don't show username on second line if username == display-name */ private fun userAndDisplayNameForPasskey( fun userAndDisplayNameForPasskey( passkeyUsername: String, passkeyDisplayName: String, ): Pair<String, String> { Loading packages/CredentialManager/src/com/android/credentialmanager/getflow/GetCredentialComponents.kt +7 −2 Original line number Diff line number Diff line Loading @@ -66,6 +66,7 @@ import com.android.credentialmanager.common.ui.HeadlineIcon import com.android.credentialmanager.common.ui.LargeLabelTextOnSurfaceVariant import com.android.credentialmanager.common.ui.Snackbar import com.android.credentialmanager.logging.GetCredentialEvent import com.android.credentialmanager.userAndDisplayNameForPasskey import com.android.internal.logging.UiEventLogger.UiEventEnum @Composable Loading Loading @@ -457,6 +458,10 @@ fun CredentialEntryRow( enforceOneLine: Boolean = false, onTextLayout: (TextLayoutResult) -> Unit = {}, ) { val (username, displayName) = if (credentialEntryInfo.credentialType == CredentialType.PASSKEY) userAndDisplayNameForPasskey( credentialEntryInfo.userName, credentialEntryInfo.displayName ?: "") else Pair(credentialEntryInfo.userName, credentialEntryInfo.displayName) Entry( onClick = { onEntrySelected(credentialEntryInfo) }, iconImageBitmap = credentialEntryInfo.icon?.toBitmap()?.asImageBitmap(), Loading @@ -465,13 +470,13 @@ fun CredentialEntryRow( iconPainter = if (credentialEntryInfo.icon == null) painterResource(R.drawable.ic_other_sign_in_24) else null, entryHeadlineText = credentialEntryInfo.userName, entryHeadlineText = username, entrySecondLineText = if ( credentialEntryInfo.credentialType == CredentialType.PASSWORD) { "••••••••••••" } else { val itemsToDisplay = listOf( credentialEntryInfo.displayName, displayName, credentialEntryInfo.credentialTypeDisplayName, credentialEntryInfo.providerDisplayName ).filterNot(TextUtils::isEmpty) Loading Loading
packages/CredentialManager/src/com/android/credentialmanager/DataConverter.kt +3 −10 Original line number Diff line number Diff line Loading @@ -252,13 +252,6 @@ class GetFlowUtils { )) } is PublicKeyCredentialEntry -> { val passkeyUsername = credentialEntry.username.toString() val passkeyDisplayName = credentialEntry.displayName?.toString() ?: "" val (username, displayName) = userAndDisplayNameForPasskey( passkeyUsername = passkeyUsername, passkeyDisplayName = passkeyDisplayName, ) result.add(CredentialEntryInfo( providerId = providerId, providerDisplayName = providerLabel, Loading @@ -268,8 +261,8 @@ class GetFlowUtils { fillInIntent = it.frameworkExtrasIntent, credentialType = CredentialType.PASSKEY, credentialTypeDisplayName = credentialEntry.typeDisplayName.toString(), userName = username, displayName = displayName, userName = credentialEntry.username.toString(), displayName = credentialEntry.displayName?.toString(), icon = credentialEntry.icon.loadDrawable(context), shouldTintIcon = credentialEntry.isDefaultIcon, lastUsedTimeMillis = credentialEntry.lastUsedTime, Loading Loading @@ -707,7 +700,7 @@ class CreateFlowUtils { * 2) username on top if display-name is not available. * 3) don't show username on second line if username == display-name */ private fun userAndDisplayNameForPasskey( fun userAndDisplayNameForPasskey( passkeyUsername: String, passkeyDisplayName: String, ): Pair<String, String> { Loading
packages/CredentialManager/src/com/android/credentialmanager/getflow/GetCredentialComponents.kt +7 −2 Original line number Diff line number Diff line Loading @@ -66,6 +66,7 @@ import com.android.credentialmanager.common.ui.HeadlineIcon import com.android.credentialmanager.common.ui.LargeLabelTextOnSurfaceVariant import com.android.credentialmanager.common.ui.Snackbar import com.android.credentialmanager.logging.GetCredentialEvent import com.android.credentialmanager.userAndDisplayNameForPasskey import com.android.internal.logging.UiEventLogger.UiEventEnum @Composable Loading Loading @@ -457,6 +458,10 @@ fun CredentialEntryRow( enforceOneLine: Boolean = false, onTextLayout: (TextLayoutResult) -> Unit = {}, ) { val (username, displayName) = if (credentialEntryInfo.credentialType == CredentialType.PASSKEY) userAndDisplayNameForPasskey( credentialEntryInfo.userName, credentialEntryInfo.displayName ?: "") else Pair(credentialEntryInfo.userName, credentialEntryInfo.displayName) Entry( onClick = { onEntrySelected(credentialEntryInfo) }, iconImageBitmap = credentialEntryInfo.icon?.toBitmap()?.asImageBitmap(), Loading @@ -465,13 +470,13 @@ fun CredentialEntryRow( iconPainter = if (credentialEntryInfo.icon == null) painterResource(R.drawable.ic_other_sign_in_24) else null, entryHeadlineText = credentialEntryInfo.userName, entryHeadlineText = username, entrySecondLineText = if ( credentialEntryInfo.credentialType == CredentialType.PASSWORD) { "••••••••••••" } else { val itemsToDisplay = listOf( credentialEntryInfo.displayName, displayName, credentialEntryInfo.credentialTypeDisplayName, credentialEntryInfo.providerDisplayName ).filterNot(TextUtils::isEmpty) Loading