From 1fd983bde132a272cd2f8a3e5eaa1592233232eb Mon Sep 17 00:00:00 2001 From: TYM Tsai Date: Tue, 3 May 2022 18:59:27 +0800 Subject: [PATCH] Fix AutofillManager and Session status not sync with fill dialog AutofillManager only allow show fill dialog once, but Autofill Session is not. Make Session diabled after shown fill dialog. Bug: 230526485 Test: atest android.autofillservice.cts.dialog.LoginActivityTest Test: Manual - click two fields that supported fill dialog. Result - second field does not show fill dialog. Change-Id: I1145c3b44058143b6751c27f1e5619d7a4ebea58 --- .../autofill/java/com/android/server/autofill/Session.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/services/autofill/java/com/android/server/autofill/Session.java b/services/autofill/java/com/android/server/autofill/Session.java index 8e32a7a8e255c..6d3620fa2ee6e 100644 --- a/services/autofill/java/com/android/server/autofill/Session.java +++ b/services/autofill/java/com/android/server/autofill/Session.java @@ -3225,10 +3225,15 @@ final class Session implements RemoteFillService.FillServiceCallbacks, ViewState currentView.setState(ViewState.STATE_FILL_DIALOG_SHOWN); mService.logDatasetShown(id, mClientState, UI_TYPE_DIALOG); } + // Just show fill dialog once, so disabled after shown. + // Note: Cannot disable before requestShowFillDialog() because the method + // need to check whether fill dialog enabled. + setFillDialogDisabled(); return; } else { setFillDialogDisabled(); } + } if (response.supportsInlineSuggestions()) {