From 3b11f9cefda90e4184693614378db79f0e43e731 Mon Sep 17 00:00:00 2001 From: Helen Qin Date: Wed, 3 May 2023 18:36:24 +0000 Subject: [PATCH] Support sign-in title variant 'Use your saved password for ?' So far we have variant: - Use your saved passkey for ? - Use your sign-in for ? - Choose a sign-in for ? This change adds: - Use your saved password for ? Bug: 280483679 Test: manual (see screenshots in bug) Change-Id: I7aa953ef6a0ec737e2ec51af4f6e2a8cc7b10c30 --- .../getflow/GetCredentialComponents.kt | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/packages/CredentialManager/src/com/android/credentialmanager/getflow/GetCredentialComponents.kt b/packages/CredentialManager/src/com/android/credentialmanager/getflow/GetCredentialComponents.kt index 74933c9e3da63..7651c51050ee4 100644 --- a/packages/CredentialManager/src/com/android/credentialmanager/getflow/GetCredentialComponents.kt +++ b/packages/CredentialManager/src/com/android/credentialmanager/getflow/GetCredentialComponents.kt @@ -215,10 +215,12 @@ fun PrimarySelectionCard( HeadlineText( text = stringResource( if (hasSingleEntry) { - if (sortedUserNameToCredentialEntryList.firstOrNull() - ?.sortedCredentialEntryList?.first()?.credentialType - == CredentialType.PASSKEY - ) R.string.get_dialog_title_use_passkey_for + val singleEntryType = sortedUserNameToCredentialEntryList.firstOrNull() + ?.sortedCredentialEntryList?.first()?.credentialType + if (singleEntryType == CredentialType.PASSKEY) + R.string.get_dialog_title_use_passkey_for + else if (singleEntryType == CredentialType.PASSWORD) + R.string.get_dialog_title_use_password_for else R.string.get_dialog_title_use_sign_in_for } else R.string.get_dialog_title_choose_sign_in_for, requestDisplayInfo.appName