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 |
The service asked to delay save. |
static Int |
A |
static Int |
A committed autofill context for which the autofill service provided datasets. |
static Int |
A dataset selector was shown. |
static Int |
A |
static Int |
A dataset was selected. |
static Int |
A save UI was shown. |
static Int |
The app/user requested for a field to be Autofilled. |
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 | |
---|---|
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 |
String? |
Returns the id of dataset the id was on. |
MutableMap<AutofillId!, FieldClassification!> |
Gets the field classification results. |
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. |
Int |
getType() Returns the type of the event. |
Int |
Returns fill suggestion ui presentation type which corresponds to types defined in |
String |
toString() |
Constants
NO_SAVE_UI_REASON_DATASET_MATCH
static val NO_SAVE_UI_REASON_DATASET_MATCH: Int
All fields matched contents of datasets.
Value: 6
NO_SAVE_UI_REASON_FIELD_VALIDATION_FAILED
static val NO_SAVE_UI_REASON_FIELD_VALIDATION_FAILED: Int
Fields failed validation.
Value: 5
NO_SAVE_UI_REASON_HAS_EMPTY_REQUIRED
static val NO_SAVE_UI_REASON_HAS_EMPTY_REQUIRED: Int
There was empty value for required ids.
Value: 3
NO_SAVE_UI_REASON_NONE
static val NO_SAVE_UI_REASON_NONE: Int
No reason for save dialog.
Value: 0
NO_SAVE_UI_REASON_NO_SAVE_INFO
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
static val NO_SAVE_UI_REASON_NO_VALUE_CHANGED: Int
No value has been changed.
Value: 4
NO_SAVE_UI_REASON_WITH_DELAY_SAVE_FLAG
static val NO_SAVE_UI_REASON_WITH_DELAY_SAVE_FLAG: Int
The service asked to delay save.
Value: 2
TYPE_AUTHENTICATION_SELECTED
static val TYPE_AUTHENTICATION_SELECTED: Int
A fill response authentication
was selected.
Value: 2
TYPE_CONTEXT_COMMITTED
static val TYPE_CONTEXT_COMMITTED: Int
A committed autofill context for which the autofill service provided datasets.
This event is useful to track:
- Which datasets (if any) were selected by the user (
getSelectedDatasetIds()
). - Which datasets (if any) were NOT selected by the user (
getIgnoredDatasetIds()
). - Which fields in the selected datasets were changed by the user after the dataset was selected (
getChangedFields()
. - Which fields match the
UserData
set by the service.
Note: This event is only generated when:
- The autofill context is committed.
- The service provides at least one dataset in the
fill responses
associated with the context. - The last
fill responses
associated with the context has theFillResponse#FLAG_TRACK_CONTEXT_COMMITED
flag.
See android.view.autofill.AutofillManager
for more information about autofill contexts.
Value: 4
TYPE_DATASETS_SHOWN
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
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
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_VIEW_REQUESTED_AUTOFILL
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_DIALOG
static val UI_TYPE_DIALOG: Int
The autofill suggestion is shown as a dialog presentation.
Value: 3
UI_TYPE_INLINE
static val UI_TYPE_INLINE: Int
The autofill suggestion is shown as a keyboard inline presentation.
Value: 2
UI_TYPE_MENU
static val UI_TYPE_MENU: Int
The autofill suggestion is shown as a menu popup presentation.
Value: 1
UI_TYPE_UNKNOWN
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
getChangedFields
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
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 android.service.autofill.AutofillService#onFillRequest(android.service.autofill.FillRequest,android.os.CancellationSignal,android.service.autofill.FillCallback)
, which is not necessary the same app being autofilled now.
Return | |
---|---|
Bundle? |
This value may be null . |
getDatasetId
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
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 . |
getIgnoredDatasetIds
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
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
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.
getSelectedDatasetIds
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 . |
getType
fun getType(): Int
Returns the type of the event.
Return | |
---|---|
Int |
The type of the event |
getUiType
fun getUiType(): Int
Returns fill suggestion ui presentation type which corresponds to types defined in ).
toString
fun toString(): String
Return | |
---|---|
String |
a string representation of the object. |