diff options
5 files changed, 13 insertions, 6 deletions
diff --git a/packages/CredentialManager/res/layout/credman_dropdown_bottom_sheet.xml b/packages/CredentialManager/res/layout/credman_dropdown_bottom_sheet.xml index fdda9ea06ab9..910ff962a231 100644 --- a/packages/CredentialManager/res/layout/credman_dropdown_bottom_sheet.xml +++ b/packages/CredentialManager/res/layout/credman_dropdown_bottom_sheet.xml @@ -17,7 +17,7 @@ android:id="@android:id/content" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:minWidth="@dimen/dropdown_touch_target_min_width" + android:minHeight="@dimen/dropdown_touch_target_min_height" android:orientation="horizontal" android:layout_marginEnd="@dimen/dropdown_layout_horizontal_margin" android:elevation="3dp"> diff --git a/packages/CredentialManager/res/layout/credman_dropdown_presentation_layout.xml b/packages/CredentialManager/res/layout/credman_dropdown_presentation_layout.xml index c7c2fda6a489..4bf0e990126e 100644 --- a/packages/CredentialManager/res/layout/credman_dropdown_presentation_layout.xml +++ b/packages/CredentialManager/res/layout/credman_dropdown_presentation_layout.xml @@ -17,7 +17,7 @@ android:id="@android:id/content" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:minWidth="@dimen/dropdown_touch_target_min_width" + android:minHeight="@dimen/dropdown_touch_target_min_height" android:layout_marginEnd="@dimen/dropdown_layout_horizontal_margin" android:elevation="3dp"> diff --git a/packages/CredentialManager/res/values/dimens.xml b/packages/CredentialManager/res/values/dimens.xml index 53852cbd0d10..b47a4dc2b76f 100644 --- a/packages/CredentialManager/res/values/dimens.xml +++ b/packages/CredentialManager/res/values/dimens.xml @@ -26,6 +26,6 @@ <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">3</integer> - <dimen name="dropdown_touch_target_min_width">48dp</dimen> + <integer name="autofill_max_visible_datasets">5</integer> + <dimen name="dropdown_touch_target_min_height">48dp</dimen> </resources>
\ No newline at end of file diff --git a/packages/CredentialManager/src/com/android/credentialmanager/autofill/CredentialAutofillService.kt b/packages/CredentialManager/src/com/android/credentialmanager/autofill/CredentialAutofillService.kt index 1f1d236f2108..d1d2c0ba13f9 100644 --- a/packages/CredentialManager/src/com/android/credentialmanager/autofill/CredentialAutofillService.kt +++ b/packages/CredentialManager/src/com/android/credentialmanager/autofill/CredentialAutofillService.kt @@ -315,7 +315,7 @@ class CredentialAutofillService : AutofillService() { maxInlineItemCount = maxInlineItemCount.coerceAtMost(inlineMaxSuggestedCount) val lastDropdownDatasetIndex = Settings.Global.getInt(this.contentResolver, Settings.Global.AUTOFILL_MAX_VISIBLE_DATASETS, - (maxDropdownDisplayLimit - 1).coerceAtMost(totalEntryCount - 1)) + (maxDropdownDisplayLimit - 1)).coerceAtMost(totalEntryCount - 1) var i = 0 var datasetAdded = false diff --git a/services/autofill/java/com/android/server/autofill/ui/FillUi.java b/services/autofill/java/com/android/server/autofill/ui/FillUi.java index b2716ecc0cfc..d580f3a7d7d8 100644 --- a/services/autofill/java/com/android/server/autofill/ui/FillUi.java +++ b/services/autofill/java/com/android/server/autofill/ui/FillUi.java @@ -15,6 +15,7 @@ */ package com.android.server.autofill.ui; +import static android.service.autofill.FillRequest.FLAG_VIEW_REQUESTS_CREDMAN_SERVICE; import static com.android.server.autofill.Helper.paramsToString; import static com.android.server.autofill.Helper.sDebug; import static com.android.server.autofill.Helper.sFullScreenMode; @@ -31,6 +32,7 @@ import android.graphics.drawable.Drawable; import android.service.autofill.Dataset; import android.service.autofill.Dataset.DatasetFieldFilter; import android.service.autofill.FillResponse; +import android.service.autofill.Flags; import android.text.TextUtils; import android.util.PluralsMessageFormatter; import android.util.Slog; @@ -79,6 +81,7 @@ final class FillUi { com.android.internal.R.style.Theme_DeviceDefault_Light_Autofill; private static final int THEME_ID_DARK = com.android.internal.R.style.Theme_DeviceDefault_Autofill; + private static final int AUTOFILL_CREDMAN_MAX_VISIBLE_DATASETS = 5; private static final TypedValue sTempTypedValue = new TypedValue(); @@ -211,7 +214,11 @@ final class FillUi { if (sVerbose) { Slog.v(TAG, "overriding maximum visible datasets to " + mVisibleDatasetsMaxCount); } - } else { + } else if (Flags.autofillCredmanIntegration() && ( + (response.getFlags() & FLAG_VIEW_REQUESTS_CREDMAN_SERVICE) != 0)) { + mVisibleDatasetsMaxCount = AUTOFILL_CREDMAN_MAX_VISIBLE_DATASETS; + } + else { mVisibleDatasetsMaxCount = mContext.getResources() .getInteger(com.android.internal.R.integer.autofill_max_visible_datasets); } |