Loading packages/CredentialManager/res/values/dimens.xml +1 −1 Original line number Diff line number Diff line Loading @@ -26,7 +26,7 @@ <dimen name="autofill_dropdown_textview_min_width">112dp</dimen> <dimen name="autofill_dropdown_textview_max_width">230dp</dimen> <dimen name="dropdown_layout_horizontal_margin">24dp</dimen> <integer name="autofill_max_visible_datasets">5</integer> <integer name="autofill_max_visible_datasets">4</integer> <dimen name="dropdown_touch_target_min_height">48dp</dimen> <dimen name="horizontal_chip_padding">8dp</dimen> <dimen name="vertical_chip_padding">6dp</dimen> Loading packages/CredentialManager/src/com/android/credentialmanager/autofill/CredentialAutofillService.kt +11 −19 Original line number Diff line number Diff line Loading @@ -240,17 +240,11 @@ class CredentialAutofillService : AutofillService() { val providerDisplayInfo: ProviderDisplayInfo = toProviderDisplayInfo(providerList) var totalEntryCount = providerDisplayInfo.sortedUserNameToCredentialEntryList.size val inlineSuggestionsRequest = filLRequest.inlineSuggestionsRequest val inlineMaxSuggestedCount = inlineSuggestionsRequest?.maxSuggestionCount ?: 0 val inlinePresentationSpecs = inlineSuggestionsRequest?.inlinePresentationSpecs val inlinePresentationSpecsCount = inlinePresentationSpecs?.size ?: 0 val maxDropdownDisplayLimit = this.resources.getInteger( val maxDatasetDisplayLimit = this.resources.getInteger( com.android.credentialmanager.R.integer.autofill_max_visible_datasets) var maxInlineItemCount = totalEntryCount maxInlineItemCount = maxInlineItemCount.coerceAtMost(inlineMaxSuggestedCount) val lastDropdownDatasetIndex = Settings.Global.getInt(this.contentResolver, Settings.Global.AUTOFILL_MAX_VISIBLE_DATASETS, (maxDropdownDisplayLimit - 1)).coerceAtMost(totalEntryCount) .coerceAtMost(totalEntryCount) var i = 0 var datasetAdded = false Loading @@ -275,7 +269,7 @@ class CredentialAutofillService : AutofillService() { Log.e(TAG, "PendingIntent was missing from the entry.") return@usernameLoop } if (i >= maxInlineItemCount && i >= lastDropdownDatasetIndex) { if (i >= maxDatasetDisplayLimit) { return@usernameLoop } val icon: Icon = if (primaryEntry.icon == null) { Loading @@ -288,7 +282,7 @@ class CredentialAutofillService : AutofillService() { } // Create inline presentation var inlinePresentation: InlinePresentation? = null if (inlinePresentationSpecs != null && i < maxInlineItemCount) { if (inlinePresentationSpecs != null && i < maxDatasetDisplayLimit) { val spec: InlinePresentationSpec? = if (i < inlinePresentationSpecsCount) { inlinePresentationSpecs[i] } else { Loading @@ -302,7 +296,7 @@ class CredentialAutofillService : AutofillService() { } } var dropdownPresentation: RemoteViews? = null if (i < lastDropdownDatasetIndex) { if (i < maxDatasetDisplayLimit) { dropdownPresentation = RemoteViewsFactory .createDropdownPresentation(this, icon, primaryEntry) } Loading @@ -328,18 +322,16 @@ class CredentialAutofillService : AutofillService() { .build()) datasetAdded = true i++ if (i == lastDropdownDatasetIndex) { addDropdownMoreOptionsPresentation(bottomSheetIntent, autofillId, fillResponseBuilder) } } val pinnedSpec = getLastInlinePresentationSpec(inlinePresentationSpecs, inlinePresentationSpecsCount) if (datasetAdded && pinnedSpec != null) { if (datasetAdded) { addDropdownMoreOptionsPresentation(bottomSheetIntent, autofillId, fillResponseBuilder) if (pinnedSpec != null) { addPinnedInlineSuggestion(pinnedSpec, autofillId, fillResponseBuilder, bottomSheetIntent) } } return datasetAdded } Loading Loading
packages/CredentialManager/res/values/dimens.xml +1 −1 Original line number Diff line number Diff line Loading @@ -26,7 +26,7 @@ <dimen name="autofill_dropdown_textview_min_width">112dp</dimen> <dimen name="autofill_dropdown_textview_max_width">230dp</dimen> <dimen name="dropdown_layout_horizontal_margin">24dp</dimen> <integer name="autofill_max_visible_datasets">5</integer> <integer name="autofill_max_visible_datasets">4</integer> <dimen name="dropdown_touch_target_min_height">48dp</dimen> <dimen name="horizontal_chip_padding">8dp</dimen> <dimen name="vertical_chip_padding">6dp</dimen> Loading
packages/CredentialManager/src/com/android/credentialmanager/autofill/CredentialAutofillService.kt +11 −19 Original line number Diff line number Diff line Loading @@ -240,17 +240,11 @@ class CredentialAutofillService : AutofillService() { val providerDisplayInfo: ProviderDisplayInfo = toProviderDisplayInfo(providerList) var totalEntryCount = providerDisplayInfo.sortedUserNameToCredentialEntryList.size val inlineSuggestionsRequest = filLRequest.inlineSuggestionsRequest val inlineMaxSuggestedCount = inlineSuggestionsRequest?.maxSuggestionCount ?: 0 val inlinePresentationSpecs = inlineSuggestionsRequest?.inlinePresentationSpecs val inlinePresentationSpecsCount = inlinePresentationSpecs?.size ?: 0 val maxDropdownDisplayLimit = this.resources.getInteger( val maxDatasetDisplayLimit = this.resources.getInteger( com.android.credentialmanager.R.integer.autofill_max_visible_datasets) var maxInlineItemCount = totalEntryCount maxInlineItemCount = maxInlineItemCount.coerceAtMost(inlineMaxSuggestedCount) val lastDropdownDatasetIndex = Settings.Global.getInt(this.contentResolver, Settings.Global.AUTOFILL_MAX_VISIBLE_DATASETS, (maxDropdownDisplayLimit - 1)).coerceAtMost(totalEntryCount) .coerceAtMost(totalEntryCount) var i = 0 var datasetAdded = false Loading @@ -275,7 +269,7 @@ class CredentialAutofillService : AutofillService() { Log.e(TAG, "PendingIntent was missing from the entry.") return@usernameLoop } if (i >= maxInlineItemCount && i >= lastDropdownDatasetIndex) { if (i >= maxDatasetDisplayLimit) { return@usernameLoop } val icon: Icon = if (primaryEntry.icon == null) { Loading @@ -288,7 +282,7 @@ class CredentialAutofillService : AutofillService() { } // Create inline presentation var inlinePresentation: InlinePresentation? = null if (inlinePresentationSpecs != null && i < maxInlineItemCount) { if (inlinePresentationSpecs != null && i < maxDatasetDisplayLimit) { val spec: InlinePresentationSpec? = if (i < inlinePresentationSpecsCount) { inlinePresentationSpecs[i] } else { Loading @@ -302,7 +296,7 @@ class CredentialAutofillService : AutofillService() { } } var dropdownPresentation: RemoteViews? = null if (i < lastDropdownDatasetIndex) { if (i < maxDatasetDisplayLimit) { dropdownPresentation = RemoteViewsFactory .createDropdownPresentation(this, icon, primaryEntry) } Loading @@ -328,18 +322,16 @@ class CredentialAutofillService : AutofillService() { .build()) datasetAdded = true i++ if (i == lastDropdownDatasetIndex) { addDropdownMoreOptionsPresentation(bottomSheetIntent, autofillId, fillResponseBuilder) } } val pinnedSpec = getLastInlinePresentationSpec(inlinePresentationSpecs, inlinePresentationSpecsCount) if (datasetAdded && pinnedSpec != null) { if (datasetAdded) { addDropdownMoreOptionsPresentation(bottomSheetIntent, autofillId, fillResponseBuilder) if (pinnedSpec != null) { addPinnedInlineSuggestion(pinnedSpec, autofillId, fillResponseBuilder, bottomSheetIntent) } } return datasetAdded } Loading