FillRequest
public
final
class
FillRequest
extends Object
implements
Parcelable
| java.lang.Object | |
| ↳ | 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 | |
|---|---|
int |
FLAG_COMPATIBILITY_MODE_REQUEST
Indicates this request was made using compatibility mode. |
int |
FLAG_MANUAL_REQUEST
Indicates autofill was explicitly requested by the user. |
Inherited constants |
|---|
Fields | |
|---|---|
public
static
final
Creator<FillRequest> |
CREATOR
|
Public methods | |
|---|---|
int
|
describeContents()
Describe the kinds of special objects contained in this Parcelable instance's marshaled representation. |
Bundle
|
getClientState()
Gets the latest client state bundle set by the service in a
|
IntentSender
|
getDelayedFillIntentSender()
Gets the |
List<FillContext>
|
getFillContexts()
Gets the contexts associated with each previous fill request. |
int
|
getFlags()
Gets the flags associated with this request. |
int
|
getId()
Gets the unique id of this request. |
InlineSuggestionsRequest
|
getInlineSuggestionsRequest()
Gets the |
String
|
toString()
Returns a string representation of the object. |
void
|
writeToParcel(Parcel dest, int flags)
Flatten this object in to a Parcel. |
Inherited methods | |
|---|---|
Constants
FLAG_COMPATIBILITY_MODE_REQUEST
public static final int FLAG_COMPATIBILITY_MODE_REQUEST
Indicates this request was made using
compatibility mode.
Value is either 0 or a combination of FLAG_MANUAL_REQUEST, FLAG_COMPATIBILITY_MODE_REQUEST, android.service.autofill.FillRequest.FLAG_PASSWORD_INPUT_TYPE, android.service.autofill.FillRequest.FLAG_VIEW_NOT_FOCUSED, and android.service.autofill.FillRequest.FLAG_ACTIVITY_START
Constant Value: 2 (0x00000002)
FLAG_MANUAL_REQUEST
public static final int FLAG_MANUAL_REQUEST
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
AssistStructure.ViewNode.isFocused() method returns true).
An explicit autofill request is triggered when the
AutofillManager.requestAutofill(View) or
AutofillManager.requestAutofill(View, int, android.graphics.Rect)
is called. For example, standard TextView views show an
AUTOFILL option in the overflow menu that triggers such request.
Value is either 0 or a combination of FLAG_MANUAL_REQUEST, FLAG_COMPATIBILITY_MODE_REQUEST, android.service.autofill.FillRequest.FLAG_PASSWORD_INPUT_TYPE, android.service.autofill.FillRequest.FLAG_VIEW_NOT_FOCUSED, and android.service.autofill.FillRequest.FLAG_ACTIVITY_START
Constant Value: 1 (0x00000001)
Fields
Public methods
describeContents
public int describeContents ()
Describe the kinds of special objects contained in this Parcelable
instance's marshaled representation. For example, if the object will
include a file descriptor in the output of writeToParcel(android.os.Parcel, int),
the return value of this method must include the
CONTENTS_FILE_DESCRIPTOR bit.
| Returns | |
|---|---|
int |
a bitmask indicating the set of special object types marshaled
by this Parcelable object instance.
Value is either 0 or CONTENTS_FILE_DESCRIPTOR |
getClientState
public Bundle getClientState ()
Gets the latest client state bundle set by the service in a
fill response.
Note: Prior to Android Build.VERSION_CODES.P, only client state
bundles set by FillResponse.Builder#setClientState(Bundle) were considered. On
Android Build.VERSION_CODES.P and higher, bundles set in the result of
an authenticated request through the
AutofillManager.EXTRA_CLIENT_STATE extra are
also considered (and take precedence when set).
| Returns | |
|---|---|
Bundle |
The client state.
This value may be null. |
getDelayedFillIntentSender
public IntentSender getDelayedFillIntentSender ()
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.
| Returns | |
|---|---|
IntentSender |
|
getFillContexts
public List<FillContext> getFillContexts ()
Gets the contexts associated with each previous fill request.
Note: Starting on Android Build.VERSION_CODES.Q, it could also
include contexts from requests whose SaveInfo had the
SaveInfo#FLAG_DELAY_SAVE flag.
| Returns | |
|---|---|
List<FillContext> |
This value cannot be null. |
getFlags
public int getFlags ()
Gets the flags associated with this request.
| Returns | |
|---|---|
int |
any combination of FLAG_MANUAL_REQUEST and
FLAG_COMPATIBILITY_MODE_REQUEST.
Value is either 0 or a combination of FLAG_MANUAL_REQUEST, FLAG_COMPATIBILITY_MODE_REQUEST, android.service.autofill.FillRequest.FLAG_PASSWORD_INPUT_TYPE, android.service.autofill.FillRequest.FLAG_VIEW_NOT_FOCUSED, and android.service.autofill.FillRequest.FLAG_ACTIVITY_START |
getInlineSuggestionsRequest
public InlineSuggestionsRequest getInlineSuggestionsRequest ()
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.
| Returns | |
|---|---|
InlineSuggestionsRequest |
the suggestionspec |
toString
public String toString ()
Returns a string representation of the object. In general, the
toString method returns a string that
"textually represents" this object. The result should
be a concise but informative representation that is easy for a
person to read.
It is recommended that all subclasses override this method.
The toString method for class Object
returns a string consisting of the name of the class of which the
object is an instance, the at-sign character `@', and
the unsigned hexadecimal representation of the hash code of the
object. In other words, this method returns a string equal to the
value of:
getClass().getName() + '@' + Integer.toHexString(hashCode())
| Returns | |
|---|---|
String |
a string representation of the object. |
writeToParcel
public void writeToParcel (Parcel dest, int flags)
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.PARCELABLE_WRITE_RETURN_VALUE.
Value is either 0 or a combination of Parcelable.PARCELABLE_WRITE_RETURN_VALUE, and android.os.Parcelable.PARCELABLE_ELIDE_DUPLICATES |