AF: Clear the existing response for the partition on a new request.
Once a new Request is in flight, we probably don't want to display the old responses. This prevents a VIEW_ENTERED flow from displaying the suggestions (either as a dropdown or as inline chips) if there is a pending request for the same partition. Thus fixing a bug where the suggestions may be rendered twice - once from the VIEW_ENTERED update and again from the Fill Request succeeding (see http://b/152620157#comment7). An example of how this may occur: 1. User taps on a View that previously showed suggestions. 2. App manually triggers autofill, which issues a new fill request. 3. The Session is updated with VIEW_ENTERED (due to (1)). Session#requestShowInlineSuggestionsLocked returns false because of the pending request. The system fallsback to drawing the dropdown UI. 4. FillRequest from (2) completes. This hides the dropdown and shows inline chips. An alternative is to exit the VIEW_ENTERED flow when there's a pending request for the same view. This should also fix the bug, but is no longer necessary with the current fix. The advantage of the current approach is that the VIEW_ENTERED update logic and the request logic are less coupled. Fix: 152620157 Test: manual Test: atest android.autofillservice.cts Change-Id: Id15887ffdf28d0a3ea32e1f68ffd81f994f93187
Loading
Please register or sign in to comment