[Autofill] Discard fill requests after save ui is displayed
There is a bug in Autofill where the saveUi gets closed as soon as it
appears. This happens when the following conditions are met.
1. FLAG_SAVE_ON_ALL_VIEWS_INVISIBLE flag is true.
2. A new view notifies of its visibility before the existing views
notify of their disappearance.
When a new view notifies of its visibility, it will request autofill
from autofill service while in parallel, saveUi will pop up from the
existing views disappearing. When processing the response from the
autofill service, saveUi will be hidden, resulting in the flashing of
the saveUi.
By the time saveUi is shown, AutoFillManager resets its state. Since the
autofill response that is processed was requested before AutofillManager
reset its state, it should discard it, or it will result in state
corruption.
Test: atest CtsAutoFillServiceTestCases, atest android.autofillservice.cts.dropdown.LoginActivityTest#testSaveUiWhenAutoFocusedToANewEditText
Bug: 283282918
Change-Id: I084c8a247a966959c0e69fb6639a0aee7067261f
1 file changed