Added in API level 26

Event


class Event
kotlin.Any
   ↳ android.service.autofill.FillEventHistory.Event

Description of an event that occurred after the latest call to FillCallback.onSuccess(FillResponse).

Summary

Constants
static Int

All fields matched contents of datasets.

static Int

Fields failed validation.

static Int

There was empty value for required ids.

static Int

No reason for save dialog.

static Int

The SaveInfo associated with the FillResponse is null.

static Int

No value has been changed.

static Int

Credential Manager is invoked instead of Autofill.

static Int

The service asked to delay save.

static Int

A fill response authentication was selected.

static Int

A committed autofill context for which the autofill service provided datasets.

static Int

A dataset selector was shown.

static Int

A dataset authentication was selected.

static Int

A dataset was selected.

static Int

The FillResponse is discarded.

static Int

A save UI was shown.

static Int

The app/user requested for a field to be Autofilled.

static Int

Credential Manager suggestions are shown instead of Autofill suggestion

static Int

The autofill suggestion is shown as a dialog presentation.

static Int

The autofill suggestion is shown as a keyboard inline presentation.

static Int

The autofill suggestion is shown as a menu popup presentation.

static Int

The autofill suggestion presentation is unknown, this will be set for the event that is unrelated to fill Ui presentation

Public methods
Boolean
equals(other: Any?)

Indicates whether some other object is "equal to" this one.

MutableMap<AutofillId!, String!>

Returns which fields in the selected datasets were changed by the user after the dataset was selected.

Bundle?

Returns the client state from the FillResponse used to generate this event.

String?

Returns the id of dataset the id was on.

MutableMap<AutofillId!, FieldClassification!>

Gets the field classification results.

AutofillId?

Gets the AutofillId that's focused at the time of action

MutableSet<String!>

Returns which datasets were NOT selected by the user.

MutableMap<AutofillId!, MutableSet<String!>!>

Returns which fields were available on datasets provided by the service but manually entered by the user.

Int

Returns the reason why a save dialog was not shown.

MutableSet<String!>

Returns which datasets were selected by the user.

MutableSet<String!>

Returns which datasets were shown to the user.

Int

Returns the type of the event.

Int

Returns fill suggestion ui presentation type which corresponds to types defined in android.service.autofill.Presentations.

Int

Returns a hash code value for the object.

String

Returns a string representation of the object.

Constants

NO_SAVE_UI_REASON_DATASET_MATCH

Added in API level 31
static val NO_SAVE_UI_REASON_DATASET_MATCH: Int

All fields matched contents of datasets.

Value: 6

NO_SAVE_UI_REASON_FIELD_VALIDATION_FAILED

Added in API level 31
static val NO_SAVE_UI_REASON_FIELD_VALIDATION_FAILED: Int

Fields failed validation.

Value: 5

NO_SAVE_UI_REASON_HAS_EMPTY_REQUIRED

Added in API level 31
static val NO_SAVE_UI_REASON_HAS_EMPTY_REQUIRED: Int

There was empty value for required ids.

Value: 3

NO_SAVE_UI_REASON_NONE

Added in API level 31
static val NO_SAVE_UI_REASON_NONE: Int

No reason for save dialog.

Value: 0

NO_SAVE_UI_REASON_NO_SAVE_INFO

Added in API level 31
static val NO_SAVE_UI_REASON_NO_SAVE_INFO: Int

The SaveInfo associated with the FillResponse is null.

Value: 1

NO_SAVE_UI_REASON_NO_VALUE_CHANGED

Added in API level 31
static val NO_SAVE_UI_REASON_NO_VALUE_CHANGED: Int

No value has been changed.

Value: 4

NO_SAVE_UI_REASON_USING_CREDMAN

Added in API level 36
static val NO_SAVE_UI_REASON_USING_CREDMAN: Int

Credential Manager is invoked instead of Autofill. When that happens, Save Dialog cannot be shown, and this will be populated in

Value: 7

NO_SAVE_UI_REASON_WITH_DELAY_SAVE_FLAG

Added in API level 31
static val NO_SAVE_UI_REASON_WITH_DELAY_SAVE_FLAG: Int

The service asked to delay save.

Value: 2

TYPE_AUTHENTICATION_SELECTED

Added in API level 26
static val TYPE_AUTHENTICATION_SELECTED: Int

A fill response authentication was selected.

Value: 2

TYPE_CONTEXT_COMMITTED

Added in API level 28
static val TYPE_CONTEXT_COMMITTED: Int

A committed autofill context for which the autofill service provided datasets.

This event is useful to track:

Note: This event is only generated when:

See android.view.autofill.AutofillManager for more information about autofill contexts.

Value: 4

TYPE_DATASETS_SHOWN

Added in API level 30
static val TYPE_DATASETS_SHOWN: Int

A dataset selector was shown.

This event is fired whenever the autofill UI was presented to the user.

Value: 5

TYPE_DATASET_AUTHENTICATION_SELECTED

Added in API level 26
static val TYPE_DATASET_AUTHENTICATION_SELECTED: Int

A dataset authentication was selected. The dataset authenticated can be read from getDatasetId().

Value: 1

TYPE_DATASET_SELECTED

Added in API level 26
static val TYPE_DATASET_SELECTED: Int

A dataset was selected. The dataset selected can be read from getDatasetId().

Note: on Android android.os.Build.VERSION_CODES#O, this event was also incorrectly reported after a dataset authentication was selected and the service returned a dataset in the AutofillManager.EXTRA_AUTHENTICATION_RESULT of the activity launched from that IntentSender. This behavior was fixed on Android android.os.Build.VERSION_CODES#O_MR1.

Value: 0

TYPE_RESPONSE_DISCARDED

Added in API level 37
static val TYPE_RESPONSE_DISCARDED: Int

The FillResponse is discarded. This could only be available in FillEventHistory of Augmented Autofill and Personal Context. This event is fired when both Augmented Autofill service and android.service.personalcontext.PersonalContextManager return non-null FillResponses, and one of them is discarded. OEMs can choose which FillResponse shall take the priority.

Value: 7

TYPE_SAVE_SHOWN

Added in API level 26
static val TYPE_SAVE_SHOWN: Int

A save UI was shown.

Value: 3

TYPE_VIEW_REQUESTED_AUTOFILL

Added in API level 34
static val TYPE_VIEW_REQUESTED_AUTOFILL: Int

The app/user requested for a field to be Autofilled. This event is fired when the view has been entered (by user or app) in order to differentiate from FillRequests that have been pretriggered for FillDialogs. For example, the user might navigate away from a screen without tapping any fields. In this case, a FillRequest/FillResponse has been generated, but was not used for Autofilling. The user did not intend to see an Autofill result, but a FillRequest was still generated. This is different from when the user did tap on a field after the pretriggered FillRequest, this event will appear in the FillEventHistory, signaling that the user did intend to Autofill something.

Value: 6

UI_TYPE_CREDENTIAL_MANAGER

Added in API level 36
static val UI_TYPE_CREDENTIAL_MANAGER: Int

Credential Manager suggestions are shown instead of Autofill suggestion

Value: 4

UI_TYPE_DIALOG

Added in API level 33
static val UI_TYPE_DIALOG: Int

The autofill suggestion is shown as a dialog presentation.

Value: 3

UI_TYPE_INLINE

Added in API level 33
static val UI_TYPE_INLINE: Int

The autofill suggestion is shown as a keyboard inline presentation.

Value: 2

UI_TYPE_MENU

Added in API level 33
static val UI_TYPE_MENU: Int

The autofill suggestion is shown as a menu popup presentation.

Value: 1

UI_TYPE_UNKNOWN

Added in API level 33
static val UI_TYPE_UNKNOWN: Int

The autofill suggestion presentation is unknown, this will be set for the event that is unrelated to fill Ui presentation

Value: 0

Public methods

equals

Added in API level 26
fun equals(other: Any?): Boolean

Indicates whether some other object is "equal to" this one.

The equals method implements an equivalence relation on non-null object references:

  • It is reflexive: for any non-null reference value x, x.equals(x) should return true.
  • It is symmetric: for any non-null reference values x and y, x.equals(y) should return true if and only if y.equals(x) returns true.
  • It is transitive: for any non-null reference values x, y, and z, if x.equals(y) returns true and y.equals(z) returns true, then x.equals(z) should return true.
  • It is consistent: for any non-null reference values x and y, multiple invocations of x.equals(y) consistently return true or consistently return false, provided no information used in equals comparisons on the objects is modified.
  • For any non-null reference value x, x.equals(null) should return false.

An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes.

Parameters
obj the reference object with which to compare.
o This value may be null.
Return
Boolean true if this object is the same as the obj argument; false otherwise.

getChangedFields

Added in API level 28
fun getChangedFields(): MutableMap<AutofillId!, String!>

Returns which fields in the selected datasets were changed by the user after the dataset was selected.

For example, server provides:

FillResponse response = new FillResponse.Builder()
       .addDataset(new Dataset.Builder(presentation1)
           .setId("4815")
           .setValue(usernameId, AutofillValue.forText("MrPlow"))
           .build())
       .addDataset(new Dataset.Builder(presentation2)
           .setId("162342")
           .setValue(passwordId, AutofillValue.forText("D'OH"))
           .build())
       .build();
  

User select both datasets (for username and password) but after the fields are autofilled, user changes them to:

username = "ElBarto";
    password = "AyCaramba";
  

Then the result is the following map:

usernameId => "4815"
    passwordId => "162342"
  

Note: Only set on events of type TYPE_CONTEXT_COMMITTED.

Return
MutableMap<AutofillId!, String!> map map whose key is the id of the change fields, and value is the id of dataset that has that field and was selected by the user.
This value cannot be null.

getClientState

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

Returns the client state from the FillResponse used to generate this event.

Note: the state is associated with the app that was autofilled in the previous AutofillService.onFillRequest(FillRequest,android.os.CancellationSignal,FillCallback), which is not necessary the same app being autofilled now.

Return
Bundle? This value may be null.

getDatasetId

Added in API level 26
fun getDatasetId(): String?

Returns the id of dataset the id was on.

Return
String? The id of dataset, or null the event is not associated with a dataset.

getFieldsClassification

Added in API level 28
fun getFieldsClassification(): MutableMap<AutofillId!, FieldClassification!>

Gets the field classification results.

Note: Only set on events of type TYPE_CONTEXT_COMMITTED, when the service requested field classification.

Return
MutableMap<AutofillId!, FieldClassification!> This value cannot be null.

getFocusedId

Added in API level 36
fun getFocusedId(): AutofillId?

Gets the AutofillId that's focused at the time of action

Return
AutofillId? This value may be null.

getIgnoredDatasetIds

Added in API level 28
fun getIgnoredDatasetIds(): MutableSet<String!>

Returns which datasets were NOT selected by the user.

Note: Only set on events of type TYPE_CONTEXT_COMMITTED.

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

getManuallyEnteredField

Added in API level 28
fun getManuallyEnteredField(): MutableMap<AutofillId!, MutableSet<String!>!>

Returns which fields were available on datasets provided by the service but manually entered by the user.

For example, server provides:

FillResponse response = new FillResponse.Builder()
       .addDataset(new Dataset.Builder(presentation1)
           .setId("4815")
           .setValue(usernameId, AutofillValue.forText("MrPlow"))
           .setValue(passwordId, AutofillValue.forText("AyCaramba"))
           .build())
       .addDataset(new Dataset.Builder(presentation2)
           .setId("162342")
           .setValue(usernameId, AutofillValue.forText("ElBarto"))
           .setValue(passwordId, AutofillValue.forText("D'OH"))
           .build())
       .addDataset(new Dataset.Builder(presentation3)
           .setId("108")
           .setValue(usernameId, AutofillValue.forText("MrPlow"))
           .setValue(passwordId, AutofillValue.forText("D'OH"))
           .build())
       .build();
  

User doesn't select a dataset but manually enters:

username = "MrPlow";
    password = "D'OH";
  

Then the result is the following map:

usernameId => { "4815", "108"}
    passwordId => { "162342", "108" }
  

Note: Only set on events of type TYPE_CONTEXT_COMMITTED.

Return
MutableMap<AutofillId!, MutableSet<String!>!> map map whose key is the id of the manually-entered field, and value is the ids of the datasets that have that value but were not selected by the user.
This value cannot be null.

getNoSaveUiReason

Added in API level 31
fun getNoSaveUiReason(): Int

Returns the reason why a save dialog was not shown.

Note: Only set on events of type TYPE_CONTEXT_COMMITTED. For the other event types, the reason is set to NO_SAVE_UI_REASON_NONE.

Return
Int The reason why a save dialog was not shown.
Value is one of the following:

getSelectedDatasetIds

Added in API level 28
fun getSelectedDatasetIds(): MutableSet<String!>

Returns which datasets were selected by the user.

Note: Only set on events of type TYPE_CONTEXT_COMMITTED.

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

getShownDatasetIds

Added in API level 36
fun getShownDatasetIds(): MutableSet<String!>

Returns which datasets were shown to the user.

Note: Only set on events of type TYPE_DATASETS_SHOWN.

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

getType

Added in API level 26
fun getType(): Int

Returns the type of the event.

Return
Int The type of the event

getUiType

Added in API level 33
fun getUiType(): Int

Returns fill suggestion ui presentation type which corresponds to types defined in android.service.autofill.Presentations.

Note: Only set on events of type TYPE_DATASETS_SHOWN and TYPE_DATASET_SELECTED. For the other event types, the type is set to UI_TYPE_UNKNOWN.

Return
Int The ui presentation type shown for user.
Value is one of the following:

hashCode

Added in API level 26
fun hashCode(): Int

Returns a hash code value for the object. This method is supported for the benefit of hash tables such as those provided by java.util.HashMap.

The general contract of hashCode is:

  • Whenever it is invoked on the same object more than once during an execution of a Java application, the hashCode method must consistently return the same integer, provided no information used in equals comparisons on the object is modified. This integer need not remain consistent from one execution of an application to another execution of the same application.
  • If two objects are equal according to the equals method, then calling the hashCode method on each of the two objects must produce the same integer result.
  • It is not required that if two objects are unequal according to the equals method, then calling the hashCode method on each of the two objects must produce distinct integer results. However, the programmer should be aware that producing distinct integer results for unequal objects may improve the performance of hash tables.
Return
Int a hash code value for this object.

toString

Added in API level 26
fun toString(): String

Returns a string representation of the object.

Return
String a string representation of the object.