summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Helen Qin <helenqin@google.com> 2023-05-04 17:32:25 +0000
committer Android (Google) Code Review <android-gerrit@google.com> 2023-05-04 17:32:25 +0000
commit6dd8509243aef9b94ef543afce61d6aadb87977e (patch)
tree83e6faf448a64aad02e4cf62d71150d4d6f6a88d
parent9b4e878548abb24652ed3a5c1e81053c7e477dc0 (diff)
parent562ad785082e6aa86e79a002d0ce2fe0281efd17 (diff)
Merge "Update the sign-in title variants." into udc-dev
-rw-r--r--packages/CredentialManager/src/com/android/credentialmanager/getflow/GetCredentialComponents.kt18
1 files changed, 16 insertions, 2 deletions
diff --git a/packages/CredentialManager/src/com/android/credentialmanager/getflow/GetCredentialComponents.kt b/packages/CredentialManager/src/com/android/credentialmanager/getflow/GetCredentialComponents.kt
index ccbd46d79437..31af7aa78c69 100644
--- a/packages/CredentialManager/src/com/android/credentialmanager/getflow/GetCredentialComponents.kt
+++ b/packages/CredentialManager/src/com/android/credentialmanager/getflow/GetCredentialComponents.kt
@@ -217,13 +217,27 @@ fun PrimarySelectionCard(
text = stringResource(
if (hasSingleEntry) {
val singleEntryType = sortedUserNameToCredentialEntryList.firstOrNull()
- ?.sortedCredentialEntryList?.first()?.credentialType
+ ?.sortedCredentialEntryList?.firstOrNull()?.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 if (authenticationEntryList.isNotEmpty())
+ R.string.get_dialog_title_unlock_options_for
else R.string.get_dialog_title_use_sign_in_for
- } else R.string.get_dialog_title_choose_sign_in_for,
+ } else {
+ if (authenticationEntryList.isNotEmpty() ||
+ sortedUserNameToCredentialEntryList.any { perNameEntryList ->
+ perNameEntryList.sortedCredentialEntryList.any { entry ->
+ entry.credentialType != CredentialType.PASSWORD &&
+ entry.credentialType != CredentialType.PASSKEY
+ }
+ }
+ )
+ R.string.get_dialog_title_choose_sign_in_for
+ else
+ R.string.get_dialog_title_choose_saved_sign_in_for
+ },
requestDisplayInfo.appName
),
)