Added in API level 26

FillRequest


class FillRequest : Parcelable
kotlin.Any
   ↳ android.service.autofill.FillRequest

This class represents a request to an autofill service to interpret the screen and provide information to the system which views are interesting for saving and what are the possible ways to fill the inputs on the screen if applicable.

Summary

Constants
static Int

Indicates this request was made using compatibility mode.

static Int

Indicates autofill was explicitly requested by the user.

static Int

Indicates the request supports fill dialog presentation for the fields, the system will send the request when the activity just started.

Inherited constants
Public methods
Int

Bundle?

Gets the latest client state bundle set by the service in a fill response.

IntentSender?

Gets the IntentSender to send a delayed fill response.

MutableList<FillContext!>

Gets the contexts associated with each previous fill request.

Int

Gets the flags associated with this request.

MutableList<String!>

Sends a list of datatypes for the Autofill Provider.

Int

Gets the unique id of this request.

InlineSuggestionsRequest?

Gets the InlineSuggestionsRequest associated with this request.

String

Unit
writeToParcel(dest: Parcel, flags: Int)

Flatten this object in to a Parcel.

Properties
static Parcelable.Creator<FillRequest!>

Constants

FLAG_COMPATIBILITY_MODE_REQUEST

Added in API level 29
static val FLAG_COMPATIBILITY_MODE_REQUEST: Int

Indicates this request was made using compatibility mode.
Value is either 0 or a combination of android.service.autofill.FillRequest#FLAG_MANUAL_REQUEST, android.service.autofill.FillRequest#FLAG_COMPATIBILITY_MODE_REQUEST, android.service.autofill.FillRequest.FLAG_PASSWORD_INPUT_TYPE, android.service.autofill.FillRequest.FLAG_VIEW_NOT_FOCUSED, android.service.autofill.FillRequest#FLAG_SUPPORTS_FILL_DIALOG, android.service.autofill.FillRequest.FLAG_IME_SHOWING, android.service.autofill.FillRequest.FLAG_RESET_FILL_DIALOG_STATE, android.service.autofill.FillRequest.FLAG_PCC_DETECTION, android.service.autofill.FillRequest.FLAG_SCREEN_HAS_CREDMAN_FIELD, and android.service.autofill.FillRequest.FLAG_VIEW_REQUESTS_CREDMAN_SERVICE

Value: 2

FLAG_MANUAL_REQUEST

Added in API level 26
static val FLAG_MANUAL_REQUEST: Int

Indicates autofill was explicitly requested by the user.

Users typically make an explicit request to autofill a screen in two situations:

  • The app disabled autofill (using View.setImportantForAutofill(int).
  • The service could not figure out how to autofill a screen (but the user knows the service has data for that app).

This flag is particularly useful for the second case. For example, the service could offer a complex UI where the user can map which screen views belong to each user data, or it could offer a simpler UI where the user picks the data for just the view used to trigger the request (that would be the view whose android.app.assist.AssistStructure.ViewNode#isFocused() method returns true).

An explicit autofill request is triggered when the android.view.autofill.AutofillManager#requestAutofill(View) or android.view.autofill.AutofillManager#requestAutofill(View, int, android.graphics.Rect) is called. For example, standard android.widget.TextView views show an AUTOFILL option in the overflow menu that triggers such request.
Value is either 0 or a combination of android.service.autofill.FillRequest#FLAG_MANUAL_REQUEST, android.service.autofill.FillRequest#FLAG_COMPATIBILITY_MODE_REQUEST, android.service.autofill.FillRequest.FLAG_PASSWORD_INPUT_TYPE, android.service.autofill.FillRequest.FLAG_VIEW_NOT_FOCUSED, android.service.autofill.FillRequest#FLAG_SUPPORTS_FILL_DIALOG, android.service.autofill.FillRequest.FLAG_IME_SHOWING, android.service.autofill.FillRequest.FLAG_RESET_FILL_DIALOG_STATE, android.service.autofill.FillRequest.FLAG_PCC_DETECTION, android.service.autofill.FillRequest.FLAG_SCREEN_HAS_CREDMAN_FIELD, and android.service.autofill.FillRequest.FLAG_VIEW_REQUESTS_CREDMAN_SERVICE

Value: 1

FLAG_SUPPORTS_FILL_DIALOG

static val FLAG_SUPPORTS_FILL_DIALOG: Int

Indicates the request supports fill dialog presentation for the fields, the system will send the request when the activity just started.
Value is either 0 or a combination of android.service.autofill.FillRequest#FLAG_MANUAL_REQUEST, android.service.autofill.FillRequest#FLAG_COMPATIBILITY_MODE_REQUEST, android.service.autofill.FillRequest.FLAG_PASSWORD_INPUT_TYPE, android.service.autofill.FillRequest.FLAG_VIEW_NOT_FOCUSED, android.service.autofill.FillRequest#FLAG_SUPPORTS_FILL_DIALOG, android.service.autofill.FillRequest.FLAG_IME_SHOWING, android.service.autofill.FillRequest.FLAG_RESET_FILL_DIALOG_STATE, android.service.autofill.FillRequest.FLAG_PCC_DETECTION, android.service.autofill.FillRequest.FLAG_SCREEN_HAS_CREDMAN_FIELD, and android.service.autofill.FillRequest.FLAG_VIEW_REQUESTS_CREDMAN_SERVICE

Value: 64

Public methods

describeContents

Added in API level 26
fun describeContents(): Int
Return
Int a bitmask indicating the set of special object types marshaled by this Parcelable object instance. Value is either 0 or android.os.Parcelable#CONTENTS_FILE_DESCRIPTOR

getClientState

Added in API level 26
fun getClientState(): Bundle?

Gets the latest client state bundle set by the service in a fill response.

Note: Prior to Android android.os.Build.VERSION_CODES#P, only client state bundles set by FillResponse.Builder.setClientState(Bundle) were considered. On Android android.os.Build.VERSION_CODES#P and higher, bundles set in the result of an authenticated request through the android.view.autofill.AutofillManager#EXTRA_CLIENT_STATE extra are also considered (and take precedence when set).

Return
Bundle? The client state. This value may be null.

getDelayedFillIntentSender

Added in API level 33
fun getDelayedFillIntentSender(): IntentSender?

Gets the IntentSender to send a delayed fill response.

The autofill service must first indicate that it wants to return a delayed FillResponse by setting FillResponse.FLAG_DELAY_FILL in a successful fill response. Then it can use this IntentSender to send an Intent with extra AutofillService.EXTRA_FILL_RESPONSE with the delayed response.

Note that this may be null if a delayed fill response is not supported for this fill request.

getFillContexts

Added in API level 26
fun getFillContexts(): MutableList<FillContext!>

Gets the contexts associated with each previous fill request.

Note: Starting on Android android.os.Build.VERSION_CODES#Q, it could also include contexts from requests whose SaveInfo had the SaveInfo.FLAG_DELAY_SAVE flag.

Return
MutableList<FillContext!> This value cannot be null.

getFlags

Added in API level 26
fun getFlags(): Int

Gets the flags associated with this request.

Return
Int any combination of FLAG_MANUAL_REQUEST, FLAG_SUPPORTS_FILL_DIALOG and FLAG_COMPATIBILITY_MODE_REQUEST. Value is either 0 or a combination of android.service.autofill.FillRequest#FLAG_MANUAL_REQUEST, android.service.autofill.FillRequest#FLAG_COMPATIBILITY_MODE_REQUEST, android.service.autofill.FillRequest.FLAG_PASSWORD_INPUT_TYPE, android.service.autofill.FillRequest.FLAG_VIEW_NOT_FOCUSED, android.service.autofill.FillRequest#FLAG_SUPPORTS_FILL_DIALOG, android.service.autofill.FillRequest.FLAG_IME_SHOWING, android.service.autofill.FillRequest.FLAG_RESET_FILL_DIALOG_STATE, android.service.autofill.FillRequest.FLAG_PCC_DETECTION, android.service.autofill.FillRequest.FLAG_SCREEN_HAS_CREDMAN_FIELD, and android.service.autofill.FillRequest.FLAG_VIEW_REQUESTS_CREDMAN_SERVICE

getHints

Added in API level 34
fun getHints(): MutableList<String!>

Sends a list of datatypes for the Autofill Provider. If this is populated, Autofill Provider should return data for the autofill hints requested here, even though the Autofill Provider may not have detected these types. The hints would be part of HintConstants: https://developer.android.com/reference/androidx/autofill/HintConstants This is populated if the platform's field detection is enabled.

Return
MutableList<String!> This value cannot be null.

getId

Added in API level 26
fun getId(): Int

Gets the unique id of this request.

getInlineSuggestionsRequest

Added in API level 30
fun getInlineSuggestionsRequest(): InlineSuggestionsRequest?

Gets the InlineSuggestionsRequest associated with this request.

Autofill Framework will send a @non-null InlineSuggestionsRequest if currently inline suggestions are supported and can be displayed. If the Autofill service wants to show inline suggestions, they may return Dataset with valid InlinePresentation.

The Autofill Service must set supportsInlineSuggestions in its XML to enable support for inline suggestions.

Return
InlineSuggestionsRequest? the suggestionspec

toString

Added in API level 26
fun toString(): String
Return
String a string representation of the object.

writeToParcel

Added in API level 26
fun writeToParcel(
    dest: Parcel,
    flags: Int
): Unit

Flatten this object in to a Parcel.

Parameters
dest Parcel: This value cannot be null.
flags Int: Additional flags about how the object should be written. May be 0 or PARCELABLE_WRITE_RETURN_VALUE. Value is either 0 or a combination of android.os.Parcelable#PARCELABLE_WRITE_RETURN_VALUE, and android.os.Parcelable.PARCELABLE_ELIDE_DUPLICATES

Properties

CREATOR

Added in API level 26
static val CREATOR: Parcelable.Creator<FillRequest!>