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

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

Merge "Several improvements and bug fixes to the inline autofill flow" into rvc-dev

parents 6f55fa3c ec496000
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -27,6 +27,7 @@ import android.os.IBinder;
import android.os.Looper;
import android.os.RemoteException;
import android.util.Log;
import android.view.autofill.AutofillId;
import android.view.inputmethod.InlineSuggestionsRequest;
import android.view.inputmethod.InlineSuggestionsResponse;

@@ -145,8 +146,8 @@ class InlineSuggestionSession {
        }

        @Override
        public void onInlineSuggestionsResponse(InlineSuggestionsResponse response)
                throws RemoteException {
        public void onInlineSuggestionsResponse(AutofillId fieldId,
                InlineSuggestionsResponse response) {
            final InlineSuggestionSession session = mInlineSuggestionSession.get();
            if (session != null) {
                session.mHandler.sendMessage(obtainMessage(
+4 −5
Original line number Diff line number Diff line
@@ -40,6 +40,7 @@ import android.os.RemoteException;
import android.os.SystemClock;
import android.service.autofill.Dataset;
import android.service.autofill.FillEventHistory;
import android.service.autofill.InlinePresentation;
import android.service.autofill.augmented.PresentationParams.SystemPopupPresentationParams;
import android.util.Log;
import android.util.Pair;
@@ -557,12 +558,10 @@ public abstract class AugmentedAutofillService extends Service {
            }
        }

        void reportResult(@Nullable List<Dataset> inlineSuggestionsData) {
        void reportResult(@Nullable List<Dataset> inlineSuggestionsData,
                @Nullable List<InlinePresentation> inlineActions) {
            try {
                final Dataset[] inlineSuggestions = (inlineSuggestionsData != null)
                        ? inlineSuggestionsData.toArray(new Dataset[inlineSuggestionsData.size()])
                        : null;
                mCallback.onSuccess(inlineSuggestions);
                mCallback.onSuccess(inlineSuggestionsData, inlineActions);
            } catch (RemoteException e) {
                Log.e(TAG, "Error calling back with the inline suggestions data: " + e);
            }
+2 −2
Original line number Diff line number Diff line
@@ -55,14 +55,14 @@ public final class FillCallback {

        if (response == null) {
            mProxy.logEvent(AutofillProxy.REPORT_EVENT_NO_RESPONSE);
            mProxy.reportResult(null /*inlineSuggestions*/);
            mProxy.reportResult(/* inlineSuggestionsData */ null, /* inlineActions */null);
            return;
        }

        List<Dataset> inlineSuggestions = response.getInlineSuggestions();
        if (inlineSuggestions != null && !inlineSuggestions.isEmpty()) {
            mProxy.logEvent(AutofillProxy.REPORT_EVENT_INLINE_RESPONSE);
            mProxy.reportResult(inlineSuggestions);
            mProxy.reportResult(inlineSuggestions, response.getInlineActions());
            return;
        }

+5 −1
Original line number Diff line number Diff line
@@ -20,6 +20,9 @@ import android.os.Bundle;
import android.os.ICancellationSignal;

import android.service.autofill.Dataset;
import android.service.autofill.InlinePresentation;

import java.util.List;

/**
 * Interface to receive the result of an autofill request.
@@ -28,7 +31,8 @@ import android.service.autofill.Dataset;
 */
interface IFillCallback {
    void onCancellable(in ICancellationSignal cancellation);
    void onSuccess(in @nullable Dataset[] inlineSuggestionsData);
    void onSuccess(in @nullable List<Dataset> inlineSuggestionsData,
                   in @nullable List<InlinePresentation> inlineActions);
    boolean isCompleted();
    void cancel();
}
+2 −1
Original line number Diff line number Diff line
@@ -16,6 +16,7 @@

package com.android.internal.view;

import android.view.autofill.AutofillId;
import android.view.inputmethod.InlineSuggestionsResponse;

/**
@@ -23,5 +24,5 @@ import android.view.inputmethod.InlineSuggestionsResponse;
 * {@hide}
 */
oneway interface IInlineSuggestionsResponseCallback {
    void onInlineSuggestionsResponse(in InlineSuggestionsResponse response);
    void onInlineSuggestionsResponse(in AutofillId fieldId, in InlineSuggestionsResponse response);
}
Loading