Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ac6d0286 authored by Tim Yu's avatar Tim Yu
Browse files

Fix Autofill for specific autofocus apps.

1. On autofocus apps, AssistStructure is requested on view load
2. On specific apps, it will autofocus away from the first autofocus field, so it Session sets mCurrentViewId = null;
3. When AssistStructure is generated, it checks for currentViewId == null. If true, returns earlys - no further Autofill actions can be done for the current view.

This change checks if there is an AssistStructure currently processing before setting mCurrentViewId to prevent the above race condition.



Fixes: 271294796
Test: On physical apps that are impacted

Change-Id: I325a88c907db2887ee5565241f74b0b511dc6915
parent 1840eb42
Loading
Loading
Loading
Loading
+9 −1
Original line number Diff line number Diff line
@@ -4188,7 +4188,15 @@ final class Session implements RemoteFillService.FillServiceCallbacks, ViewState
                    // We don't send an empty response to IME so that it doesn't cause UI flicker
                    // on the IME side if it arrives before the input view is finished on the IME.
                    mInlineSessionController.resetInlineFillUiLocked();

                    if ((viewState.getState() &
                            ViewState.STATE_PENDING_CREATE_INLINE_REQUEST) != 0) {
                        // View was exited before Inline Request sent back, do not set it to
                        // null yet to let onHandleAssistData finish processing
                    } else {
                        mCurrentViewId = null;
                    }


                    mPresentationStatsEventLogger.maybeSetNoPresentationEventReason(
                                NOT_SHOWN_REASON_VIEW_FOCUS_CHANGED);