Loading core/java/android/service/autofill/FillResponse.java +35 −2 Original line number Original line Diff line number Diff line Loading @@ -28,6 +28,7 @@ import android.annotation.StringRes; import android.annotation.SuppressLint; import android.annotation.SuppressLint; import android.annotation.TestApi; import android.annotation.TestApi; import android.app.Activity; import android.app.Activity; import android.app.PendingIntent; import android.content.Intent; import android.content.Intent; import android.content.IntentSender; import android.content.IntentSender; import android.content.pm.ParceledListSlice; import android.content.pm.ParceledListSlice; Loading Loading @@ -116,6 +117,7 @@ public final class FillResponse implements Parcelable { private final boolean mShowFillDialogIcon; private final boolean mShowFillDialogIcon; private final boolean mShowSaveDialogIcon; private final boolean mShowSaveDialogIcon; private final @Nullable FieldClassification[] mDetectedFieldTypes; private final @Nullable FieldClassification[] mDetectedFieldTypes; private final @Nullable PendingIntent mDialogPendingIntent; /** /** * Creates a shollow copy of the provided FillResponse. * Creates a shollow copy of the provided FillResponse. Loading Loading @@ -150,7 +152,8 @@ public final class FillResponse implements Parcelable { r.mServiceDisplayNameResourceId, r.mServiceDisplayNameResourceId, r.mShowFillDialogIcon, r.mShowFillDialogIcon, r.mShowSaveDialogIcon, r.mShowSaveDialogIcon, r.mDetectedFieldTypes); r.mDetectedFieldTypes, r.mDialogPendingIntent); } } private FillResponse(ParceledListSlice<Dataset> datasets, SaveInfo saveInfo, Bundle clientState, private FillResponse(ParceledListSlice<Dataset> datasets, SaveInfo saveInfo, Bundle clientState, Loading @@ -163,7 +166,7 @@ public final class FillResponse implements Parcelable { int[] cancelIds, boolean supportsInlineSuggestions, int iconResourceId, int[] cancelIds, boolean supportsInlineSuggestions, int iconResourceId, int serviceDisplayNameResourceId, boolean showFillDialogIcon, int serviceDisplayNameResourceId, boolean showFillDialogIcon, boolean showSaveDialogIcon, boolean showSaveDialogIcon, FieldClassification[] detectedFieldTypes) { FieldClassification[] detectedFieldTypes, PendingIntent dialogPendingIntent) { mDatasets = datasets; mDatasets = datasets; mSaveInfo = saveInfo; mSaveInfo = saveInfo; mClientState = clientState; mClientState = clientState; Loading @@ -190,6 +193,7 @@ public final class FillResponse implements Parcelable { mShowFillDialogIcon = showFillDialogIcon; mShowFillDialogIcon = showFillDialogIcon; mShowSaveDialogIcon = showSaveDialogIcon; mShowSaveDialogIcon = showSaveDialogIcon; mDetectedFieldTypes = detectedFieldTypes; mDetectedFieldTypes = detectedFieldTypes; mDialogPendingIntent = dialogPendingIntent; } } private FillResponse(@NonNull Builder builder) { private FillResponse(@NonNull Builder builder) { Loading Loading @@ -219,6 +223,7 @@ public final class FillResponse implements Parcelable { mShowFillDialogIcon = builder.mShowFillDialogIcon; mShowFillDialogIcon = builder.mShowFillDialogIcon; mShowSaveDialogIcon = builder.mShowSaveDialogIcon; mShowSaveDialogIcon = builder.mShowSaveDialogIcon; mDetectedFieldTypes = builder.mDetectedFieldTypes; mDetectedFieldTypes = builder.mDetectedFieldTypes; mDialogPendingIntent = builder.mDialogPendingIntent; } } /** @hide */ /** @hide */ Loading Loading @@ -399,6 +404,7 @@ public final class FillResponse implements Parcelable { private boolean mShowFillDialogIcon = true; private boolean mShowFillDialogIcon = true; private boolean mShowSaveDialogIcon = true; private boolean mShowSaveDialogIcon = true; private FieldClassification[] mDetectedFieldTypes; private FieldClassification[] mDetectedFieldTypes; private PendingIntent mDialogPendingIntent; /** /** * Adds a new {@link FieldClassification} to this response, to * Adds a new {@link FieldClassification} to this response, to Loading Loading @@ -1078,6 +1084,24 @@ public final class FillResponse implements Parcelable { return this; return this; } } /** * Sets credential dialog pending intent. Framework will use the intent to launch the * selector UI. A replacement for previous fill bottom sheet. * * @throws IllegalStateException if {@link #build()} was already called. * @throws NullPointerException if {@code pendingIntent} is {@code null}. * * @hide */ @NonNull public Builder setDialogPendingIntent(@NonNull PendingIntent pendingIntent) { throwIfDestroyed(); Preconditions.checkNotNull(pendingIntent, "can't pass a null object to setDialogPendingIntent"); mDialogPendingIntent = pendingIntent; return this; } /** /** * Builds a new {@link FillResponse} instance. * Builds a new {@link FillResponse} instance. * * Loading Loading @@ -1187,6 +1211,9 @@ public final class FillResponse implements Parcelable { if (mAuthentication != null) { if (mAuthentication != null) { builder.append(", hasAuthentication"); builder.append(", hasAuthentication"); } } if (mDialogPendingIntent != null) { builder.append(", hasDialogPendingIntent"); } if (mAuthenticationIds != null) { if (mAuthenticationIds != null) { builder.append(", authenticationIds=").append(Arrays.toString(mAuthenticationIds)); builder.append(", authenticationIds=").append(Arrays.toString(mAuthenticationIds)); } } Loading Loading @@ -1232,6 +1259,7 @@ public final class FillResponse implements Parcelable { parcel.writeParcelable(mInlineTooltipPresentation, flags); parcel.writeParcelable(mInlineTooltipPresentation, flags); parcel.writeParcelable(mDialogPresentation, flags); parcel.writeParcelable(mDialogPresentation, flags); parcel.writeParcelable(mDialogHeader, flags); parcel.writeParcelable(mDialogHeader, flags); parcel.writeParcelable(mDialogPendingIntent, flags); parcel.writeParcelableArray(mFillDialogTriggerIds, flags); parcel.writeParcelableArray(mFillDialogTriggerIds, flags); parcel.writeParcelable(mHeader, flags); parcel.writeParcelable(mHeader, flags); parcel.writeParcelable(mFooter, flags); parcel.writeParcelable(mFooter, flags); Loading Loading @@ -1282,6 +1310,11 @@ public final class FillResponse implements Parcelable { if (dialogHeader != null) { if (dialogHeader != null) { builder.setDialogHeader(dialogHeader); builder.setDialogHeader(dialogHeader); } } final PendingIntent dialogPendingIntent = parcel.readParcelable(null, PendingIntent.class); if (dialogPendingIntent != null) { builder.setDialogPendingIntent(dialogPendingIntent); } final AutofillId[] triggerIds = parcel.readParcelableArray(null, AutofillId.class); final AutofillId[] triggerIds = parcel.readParcelableArray(null, AutofillId.class); if (triggerIds != null) { if (triggerIds != null) { builder.setFillDialogTriggerIds(triggerIds); builder.setFillDialogTriggerIds(triggerIds); Loading Loading
core/java/android/service/autofill/FillResponse.java +35 −2 Original line number Original line Diff line number Diff line Loading @@ -28,6 +28,7 @@ import android.annotation.StringRes; import android.annotation.SuppressLint; import android.annotation.SuppressLint; import android.annotation.TestApi; import android.annotation.TestApi; import android.app.Activity; import android.app.Activity; import android.app.PendingIntent; import android.content.Intent; import android.content.Intent; import android.content.IntentSender; import android.content.IntentSender; import android.content.pm.ParceledListSlice; import android.content.pm.ParceledListSlice; Loading Loading @@ -116,6 +117,7 @@ public final class FillResponse implements Parcelable { private final boolean mShowFillDialogIcon; private final boolean mShowFillDialogIcon; private final boolean mShowSaveDialogIcon; private final boolean mShowSaveDialogIcon; private final @Nullable FieldClassification[] mDetectedFieldTypes; private final @Nullable FieldClassification[] mDetectedFieldTypes; private final @Nullable PendingIntent mDialogPendingIntent; /** /** * Creates a shollow copy of the provided FillResponse. * Creates a shollow copy of the provided FillResponse. Loading Loading @@ -150,7 +152,8 @@ public final class FillResponse implements Parcelable { r.mServiceDisplayNameResourceId, r.mServiceDisplayNameResourceId, r.mShowFillDialogIcon, r.mShowFillDialogIcon, r.mShowSaveDialogIcon, r.mShowSaveDialogIcon, r.mDetectedFieldTypes); r.mDetectedFieldTypes, r.mDialogPendingIntent); } } private FillResponse(ParceledListSlice<Dataset> datasets, SaveInfo saveInfo, Bundle clientState, private FillResponse(ParceledListSlice<Dataset> datasets, SaveInfo saveInfo, Bundle clientState, Loading @@ -163,7 +166,7 @@ public final class FillResponse implements Parcelable { int[] cancelIds, boolean supportsInlineSuggestions, int iconResourceId, int[] cancelIds, boolean supportsInlineSuggestions, int iconResourceId, int serviceDisplayNameResourceId, boolean showFillDialogIcon, int serviceDisplayNameResourceId, boolean showFillDialogIcon, boolean showSaveDialogIcon, boolean showSaveDialogIcon, FieldClassification[] detectedFieldTypes) { FieldClassification[] detectedFieldTypes, PendingIntent dialogPendingIntent) { mDatasets = datasets; mDatasets = datasets; mSaveInfo = saveInfo; mSaveInfo = saveInfo; mClientState = clientState; mClientState = clientState; Loading @@ -190,6 +193,7 @@ public final class FillResponse implements Parcelable { mShowFillDialogIcon = showFillDialogIcon; mShowFillDialogIcon = showFillDialogIcon; mShowSaveDialogIcon = showSaveDialogIcon; mShowSaveDialogIcon = showSaveDialogIcon; mDetectedFieldTypes = detectedFieldTypes; mDetectedFieldTypes = detectedFieldTypes; mDialogPendingIntent = dialogPendingIntent; } } private FillResponse(@NonNull Builder builder) { private FillResponse(@NonNull Builder builder) { Loading Loading @@ -219,6 +223,7 @@ public final class FillResponse implements Parcelable { mShowFillDialogIcon = builder.mShowFillDialogIcon; mShowFillDialogIcon = builder.mShowFillDialogIcon; mShowSaveDialogIcon = builder.mShowSaveDialogIcon; mShowSaveDialogIcon = builder.mShowSaveDialogIcon; mDetectedFieldTypes = builder.mDetectedFieldTypes; mDetectedFieldTypes = builder.mDetectedFieldTypes; mDialogPendingIntent = builder.mDialogPendingIntent; } } /** @hide */ /** @hide */ Loading Loading @@ -399,6 +404,7 @@ public final class FillResponse implements Parcelable { private boolean mShowFillDialogIcon = true; private boolean mShowFillDialogIcon = true; private boolean mShowSaveDialogIcon = true; private boolean mShowSaveDialogIcon = true; private FieldClassification[] mDetectedFieldTypes; private FieldClassification[] mDetectedFieldTypes; private PendingIntent mDialogPendingIntent; /** /** * Adds a new {@link FieldClassification} to this response, to * Adds a new {@link FieldClassification} to this response, to Loading Loading @@ -1078,6 +1084,24 @@ public final class FillResponse implements Parcelable { return this; return this; } } /** * Sets credential dialog pending intent. Framework will use the intent to launch the * selector UI. A replacement for previous fill bottom sheet. * * @throws IllegalStateException if {@link #build()} was already called. * @throws NullPointerException if {@code pendingIntent} is {@code null}. * * @hide */ @NonNull public Builder setDialogPendingIntent(@NonNull PendingIntent pendingIntent) { throwIfDestroyed(); Preconditions.checkNotNull(pendingIntent, "can't pass a null object to setDialogPendingIntent"); mDialogPendingIntent = pendingIntent; return this; } /** /** * Builds a new {@link FillResponse} instance. * Builds a new {@link FillResponse} instance. * * Loading Loading @@ -1187,6 +1211,9 @@ public final class FillResponse implements Parcelable { if (mAuthentication != null) { if (mAuthentication != null) { builder.append(", hasAuthentication"); builder.append(", hasAuthentication"); } } if (mDialogPendingIntent != null) { builder.append(", hasDialogPendingIntent"); } if (mAuthenticationIds != null) { if (mAuthenticationIds != null) { builder.append(", authenticationIds=").append(Arrays.toString(mAuthenticationIds)); builder.append(", authenticationIds=").append(Arrays.toString(mAuthenticationIds)); } } Loading Loading @@ -1232,6 +1259,7 @@ public final class FillResponse implements Parcelable { parcel.writeParcelable(mInlineTooltipPresentation, flags); parcel.writeParcelable(mInlineTooltipPresentation, flags); parcel.writeParcelable(mDialogPresentation, flags); parcel.writeParcelable(mDialogPresentation, flags); parcel.writeParcelable(mDialogHeader, flags); parcel.writeParcelable(mDialogHeader, flags); parcel.writeParcelable(mDialogPendingIntent, flags); parcel.writeParcelableArray(mFillDialogTriggerIds, flags); parcel.writeParcelableArray(mFillDialogTriggerIds, flags); parcel.writeParcelable(mHeader, flags); parcel.writeParcelable(mHeader, flags); parcel.writeParcelable(mFooter, flags); parcel.writeParcelable(mFooter, flags); Loading Loading @@ -1282,6 +1310,11 @@ public final class FillResponse implements Parcelable { if (dialogHeader != null) { if (dialogHeader != null) { builder.setDialogHeader(dialogHeader); builder.setDialogHeader(dialogHeader); } } final PendingIntent dialogPendingIntent = parcel.readParcelable(null, PendingIntent.class); if (dialogPendingIntent != null) { builder.setDialogPendingIntent(dialogPendingIntent); } final AutofillId[] triggerIds = parcel.readParcelableArray(null, AutofillId.class); final AutofillId[] triggerIds = parcel.readParcelableArray(null, AutofillId.class); if (triggerIds != null) { if (triggerIds != null) { builder.setFillDialogTriggerIds(triggerIds); builder.setFillDialogTriggerIds(triggerIds); Loading