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

Commit def06118 authored by Felipe Leme's avatar Felipe Leme Committed by android-build-merger
Browse files

Merge "Adds FillResponse extra to passed to authentication intent." into oc-dev am: fb4a74f2

am: 13fa0e22

Change-Id: Ie2f167ee942feee1a5d7d83429413723f1d97986
parents 4f656ce2 13fa0e22
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -47645,6 +47645,7 @@ package android.view.autofill {
    method public void unregisterCallback(android.view.autofill.AutofillManager.AutofillCallback);
    field public static final java.lang.String EXTRA_ASSIST_STRUCTURE = "android.view.autofill.extra.ASSIST_STRUCTURE";
    field public static final java.lang.String EXTRA_AUTHENTICATION_RESULT = "android.view.autofill.extra.AUTHENTICATION_RESULT";
    field public static final java.lang.String EXTRA_DATA_EXTRAS = "android.view.autofill.extra.DATA_EXTRAS";
    field public static final int FLAG_MANUAL_REQUEST = 1; // 0x1
  }
+1 −0
Original line number Diff line number Diff line
@@ -51135,6 +51135,7 @@ package android.view.autofill {
    method public void unregisterCallback(android.view.autofill.AutofillManager.AutofillCallback);
    field public static final java.lang.String EXTRA_ASSIST_STRUCTURE = "android.view.autofill.extra.ASSIST_STRUCTURE";
    field public static final java.lang.String EXTRA_AUTHENTICATION_RESULT = "android.view.autofill.extra.AUTHENTICATION_RESULT";
    field public static final java.lang.String EXTRA_DATA_EXTRAS = "android.view.autofill.extra.DATA_EXTRAS";
    field public static final int FLAG_MANUAL_REQUEST = 1; // 0x1
  }
+1 −0
Original line number Diff line number Diff line
@@ -48028,6 +48028,7 @@ package android.view.autofill {
    method public void unregisterCallback(android.view.autofill.AutofillManager.AutofillCallback);
    field public static final java.lang.String EXTRA_ASSIST_STRUCTURE = "android.view.autofill.extra.ASSIST_STRUCTURE";
    field public static final java.lang.String EXTRA_AUTHENTICATION_RESULT = "android.view.autofill.extra.AUTHENTICATION_RESULT";
    field public static final java.lang.String EXTRA_DATA_EXTRAS = "android.view.autofill.extra.DATA_EXTRAS";
    field public static final int FLAG_MANUAL_REQUEST = 1; // 0x1
  }
+16 −2
Original line number Diff line number Diff line
@@ -56,9 +56,9 @@ public final class AutofillManager {

    /**
     * Intent extra: The assist structure which captures the filled screen.
     *
     * <p>
     * Type: {@link android.app.assist.AssistStructure}
     * </p>
     */
    public static final String EXTRA_ASSIST_STRUCTURE =
            "android.view.autofill.extra.ASSIST_STRUCTURE";
@@ -72,11 +72,25 @@ public final class AutofillManager {
     * <p>
     * Type: {@link android.service.autofill.FillResponse} or a
     * {@link android.service.autofill.Dataset}
     * </p>
     */
    public static final String EXTRA_AUTHENTICATION_RESULT =
            "android.view.autofill.extra.AUTHENTICATION_RESULT";

    /**
     * Intent extra: The optional extras provided by the
     * {@link android.service.autofill.AutofillService}.
     *
     * <p>For example, when the service responds to a {@link
     * android.service.autofill.FillCallback#onSuccess(android.service.autofill.FillResponse)} with
     * a {@code FillResponse} that requires authentication, the Intent that launches the
     * service authentication will contain the Bundle set by
     * {@link android.service.autofill.FillResponse.Builder#setExtras(Bundle)} on this extra.
     *
     * <p>
     * Type: {@link android.os.Bundle}
     */
    public static final String EXTRA_DATA_EXTRAS = "android.view.autofill.extra.DATA_EXTRAS";

    // Public flags start from the lowest bit
    /**
     * Indicates autofill was explicitly requested by the user.
+12 −8
Original line number Diff line number Diff line
@@ -244,10 +244,10 @@ final class Session implements RemoteFillService.FillServiceCallbacks, ViewState

    // FillServiceCallbacks
    @Override
    public void authenticate(IntentSender intent) {
    public void authenticate(IntentSender intent, Bundle extras) {
        final Intent fillInIntent;
        synchronized (mLock) {
            fillInIntent = createAuthFillInIntent(mStructure);
            fillInIntent = createAuthFillInIntent(mStructure, extras);
        }
        mHandlerCaller.getHandler().post(() -> startAuthentication(intent, fillInIntent));
    }
@@ -313,7 +313,7 @@ final class Session implements RemoteFillService.FillServiceCallbacks, ViewState
        if (mCurrentResponse == null || data == null) {
            removeSelf();
        } else {
            Parcelable result = data.getParcelable(
            final Parcelable result = data.getParcelable(
                    AutofillManager.EXTRA_AUTHENTICATION_RESULT);
            if (result instanceof FillResponse) {
                mMetricsLogger.action(MetricsEvent.AUTOFILL_AUTHENTICATED, mPackageName);
@@ -321,7 +321,7 @@ final class Session implements RemoteFillService.FillServiceCallbacks, ViewState
                mCurrentResponse = (FillResponse) result;
                processResponseLocked(mCurrentResponse);
            } else if (result instanceof Dataset) {
                Dataset dataset = (Dataset) result;
                final Dataset dataset = (Dataset) result;
                final int index = mCurrentResponse.getDatasets().indexOf(mAutoFilledDataset);
                if (index >= 0) {
                    mCurrentResponse.getDatasets().set(index, dataset);
@@ -614,7 +614,8 @@ final class Session implements RemoteFillService.FillServiceCallbacks, ViewState

        if (mCurrentResponse.getAuthentication() != null) {
            // Handle authentication.
            final Intent fillInIntent = createAuthFillInIntent(mStructure);
            final Intent fillInIntent = createAuthFillInIntent(mStructure,
                    mCurrentResponse.getExtras());
            mCurrentViewState.setResponse(mCurrentResponse, fillInIntent);
            return;
        }
@@ -640,7 +641,7 @@ final class Session implements RemoteFillService.FillServiceCallbacks, ViewState
            }

            // ...or handle authentication.
            Intent fillInIntent = createAuthFillInIntent(mStructure);
            final Intent fillInIntent = createAuthFillInIntent(mStructure, null);
            startAuthentication(dataset.getAuthentication(), fillInIntent);
        }
    }
@@ -649,9 +650,12 @@ final class Session implements RemoteFillService.FillServiceCallbacks, ViewState
        return mService.getServiceName();
    }

    private Intent createAuthFillInIntent(AssistStructure structure) {
        Intent fillInIntent = new Intent();
    private Intent createAuthFillInIntent(AssistStructure structure, Bundle extras) {
        final Intent fillInIntent = new Intent();
        fillInIntent.putExtra(AutofillManager.EXTRA_ASSIST_STRUCTURE, structure);
        if (extras != null) {
            fillInIntent.putExtra(AutofillManager.EXTRA_DATA_EXTRAS, extras);
        }
        return fillInIntent;
    }

Loading