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

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

Merge "New Autofill API: FillRequest.FLAG_COMPATIBILITY_MODE_REQUEST."

parents 1b745baa eacd74de
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -39085,6 +39085,7 @@ package android.service.autofill {
    method public int getId();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.service.autofill.FillRequest> CREATOR;
    field public static final int FLAG_COMPATIBILITY_MODE_REQUEST = 2; // 0x2
    field public static final int FLAG_MANUAL_REQUEST = 1; // 0x1
  }
+9 −2
Original line number Diff line number Diff line
@@ -65,12 +65,18 @@ public final class FillRequest implements Parcelable {
     */
    public static final int FLAG_MANUAL_REQUEST = 0x1;

    /**
     * Indicates this request was made using
     * <a href="AutofillService.html#CompatibilityMode">compatibility mode</a>.
     */
    public static final int FLAG_COMPATIBILITY_MODE_REQUEST = 0x2;

    /** @hide */
    public static final int INVALID_REQUEST_ID = Integer.MIN_VALUE;

    /** @hide */
    @IntDef(flag = true, prefix = { "FLAG_" }, value = {
            FLAG_MANUAL_REQUEST
            FLAG_MANUAL_REQUEST, FLAG_COMPATIBILITY_MODE_REQUEST
    })
    @Retention(RetentionPolicy.SOURCE)
    @interface RequestFlags{}
@@ -93,7 +99,8 @@ public final class FillRequest implements Parcelable {
    public FillRequest(int id, @NonNull ArrayList<FillContext> contexts,
            @Nullable Bundle clientState, @RequestFlags int flags) {
        mId = id;
        mFlags = Preconditions.checkFlagsArgument(flags, FLAG_MANUAL_REQUEST);
        mFlags = Preconditions.checkFlagsArgument(flags,
                FLAG_MANUAL_REQUEST | FLAG_COMPATIBILITY_MODE_REQUEST);
        mContexts = Preconditions.checkCollectionElementsNotNull(contexts, "contexts");
        mClientState = clientState;
    }
+4 −3
Original line number Diff line number Diff line
@@ -290,6 +290,9 @@ final class Session implements RemoteFillService.FillServiceCallbacks, ViewState
                                    componentNameFromApp == null ? "null"
                                            : componentNameFromApp.flattenToShortString()));
                }
                // Flags used to start the session.
                int flags = structure.getFlags();

                if (mCompatMode) {
                    // Sanitize URL bar, if needed
                    final String[] urlBarIds = mService.getUrlBarResourceIdsForCompatMode(
@@ -310,12 +313,10 @@ final class Session implements RemoteFillService.FillServiceCallbacks, ViewState
                            mViewStates.put(urlBarId, viewState);
                        }
                    }
                    flags |= FillRequest.FLAG_COMPATIBILITY_MODE_REQUEST;
                }
                structure.sanitizeForParceling(true);

                // Flags used to start the session.
                final int flags = structure.getFlags();

                if (mContexts == null) {
                    mContexts = new ArrayList<>(1);
                }