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

Commit fda724a5 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Disable inline suggestions for afservice when talkback is enabled." into sc-dev

parents 4e7b1128 364a5225
Loading
Loading
Loading
Loading
+12 −3
Original line number Diff line number Diff line
@@ -96,6 +96,7 @@ import android.util.Slog;
import android.util.SparseArray;
import android.util.TimeUtils;
import android.view.KeyEvent;
import android.view.accessibility.AccessibilityManager;
import android.view.autofill.AutofillId;
import android.view.autofill.AutofillManager;
import android.view.autofill.AutofillManager.SmartSuggestionMode;
@@ -346,6 +347,8 @@ final class Session implements RemoteFillService.FillServiceCallbacks, ViewState
     */
    private final AssistDataReceiverImpl mAssistReceiver = new AssistDataReceiverImpl();

    private final AccessibilityManager mAccessibilityManager;

    void onSwitchInputMethodLocked() {
        // One caveat is that for the case where the focus is on a field for which regular autofill
        // returns null, and augmented autofill is triggered,  and then the user switches the input
@@ -458,10 +461,15 @@ final class Session implements RemoteFillService.FillServiceCallbacks, ViewState
                    return;
                }

                // If a11y touch exploration is enabled, then we do not send an inline fill request
                // to the regular af service, because dropdown UI is easier to use.
                if (!mAccessibilityManager.isTouchExplorationEnabled()) {
                    mPendingFillRequest = new FillRequest(mPendingFillRequest.getId(),
                        mPendingFillRequest.getFillContexts(), mPendingFillRequest.getClientState(),
                            mPendingFillRequest.getFillContexts(),
                            mPendingFillRequest.getClientState(),
                            mPendingFillRequest.getFlags(), mPendingInlineSuggestionsRequest);
                }
            }

            mRemoteFillService.onFillRequest(mPendingFillRequest);
            mPendingInlineSuggestionsRequest = null;
@@ -889,6 +897,7 @@ final class Session implements RemoteFillService.FillServiceCallbacks, ViewState
        mRemoteFillService = serviceComponentName == null ? null
                : new RemoteFillService(context, serviceComponentName, userId, this,
                        bindInstantServiceAllowed);
        mAccessibilityManager = AccessibilityManager.getInstance(context);
        mActivityToken = activityToken;
        mHasCallback = hasCallback;
        mUiLatencyHistory = uiLatencyHistory;