summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Joy Babafemi <jbabs@google.com> 2024-02-28 23:11:21 +0000
committer Joy Babafemi <jbabs@google.com> 2024-02-28 23:47:03 +0000
commite0d673d2d0457b98f436af5ad5fd9a781e6f3db9 (patch)
treee0894b3efdad1acdaf7c25615aa828a58379f086
parentbe0d692f9b9b08f12fb3eeb18e5e2529f0f6cb77 (diff)
Fix total entry count reference
Total entry count used for inline and dropdown should reference the size of the sorted username to credential entry list (accounting for duplicate usernames) and not the total list of credential options. Bug: 326908364 Tested: Manual test Change-Id: I558a212aa1818fb3236d7ca5eed7a6b8f961ca79
-rw-r--r--packages/CredentialManager/src/com/android/credentialmanager/autofill/CredentialAutofillService.kt5
1 files changed, 1 insertions, 4 deletions
diff --git a/packages/CredentialManager/src/com/android/credentialmanager/autofill/CredentialAutofillService.kt b/packages/CredentialManager/src/com/android/credentialmanager/autofill/CredentialAutofillService.kt
index 13260231038d..c118f886a331 100644
--- a/packages/CredentialManager/src/com/android/credentialmanager/autofill/CredentialAutofillService.kt
+++ b/packages/CredentialManager/src/com/android/credentialmanager/autofill/CredentialAutofillService.kt
@@ -237,11 +237,8 @@ class CredentialAutofillService : AutofillService() {
if (providerList.isEmpty()) {
return false
}
- var totalEntryCount = 0
- providerList.forEach { provider ->
- totalEntryCount += provider.credentialEntryList.size
- }
val providerDisplayInfo: ProviderDisplayInfo = toProviderDisplayInfo(providerList)
+ var totalEntryCount = providerDisplayInfo.sortedUserNameToCredentialEntryList.size
val inlineSuggestionsRequest = filLRequest.inlineSuggestionsRequest
val inlineMaxSuggestedCount = inlineSuggestionsRequest?.maxSuggestionCount ?: 0
val inlinePresentationSpecs = inlineSuggestionsRequest?.inlinePresentationSpecs