FillEventHistory.Event


public static final class FillEventHistory.Event
extends Object

java.lang.Object
   ↳ android.service.autofill.FillEventHistory.Event


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

Summary

Constants

int NO_SAVE_UI_REASON_DATASET_MATCH

All fields matched contents of datasets.

int NO_SAVE_UI_REASON_FIELD_VALIDATION_FAILED

Fields failed validation.

int NO_SAVE_UI_REASON_HAS_EMPTY_REQUIRED

There was empty value for required ids.

int NO_SAVE_UI_REASON_NONE

No reason for save dialog.

int NO_SAVE_UI_REASON_NO_SAVE_INFO

The SaveInfo associated with the FillResponse is null.

int NO_SAVE_UI_REASON_NO_VALUE_CHANGED

No value has been changed.

int NO_SAVE_UI_REASON_USING_CREDMAN

Credential Manager is invoked instead of Autofill.

int NO_SAVE_UI_REASON_WITH_DELAY_SAVE_FLAG

The service asked to delay save.

int TYPE_AUTHENTICATION_SELECTED

A fill response authentication was selected.

int TYPE_CONTEXT_COMMITTED

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

int TYPE_DATASETS_SHOWN

A dataset selector was shown.

int TYPE_DATASET_AUTHENTICATION_SELECTED

A dataset authentication was selected.

int TYPE_DATASET_SELECTED

A dataset was selected.

int TYPE_RESPONSE_DISCARDED

The FillResponse is discarded.

int TYPE_SAVE_SHOWN

A save UI was shown.

int TYPE_VIEW_REQUESTED_AUTOFILL

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

int UI_TYPE_CREDENTIAL_MANAGER

Credential Manager suggestions are shown instead of Autofill suggestion

int UI_TYPE_DIALOG

The autofill suggestion is shown as a dialog presentation.

int UI_TYPE_INLINE

The autofill suggestion is shown as a keyboard inline presentation.

int UI_TYPE_MENU

The autofill suggestion is shown as a menu popup presentation.

int UI_TYPE_UNKNOWN

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

Public methods

boolean equals(Object o)

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

Map<AutofillIdString> getChangedFields()

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

Bundle getClientState()

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

String getDatasetId()

Returns the id of dataset the id was on.

Map<AutofillIdFieldClassification> getFieldsClassification()

Gets the field classification results.

AutofillId getFocusedId()

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

Set<String> getIgnoredDatasetIds()

Returns which datasets were NOT selected by the user.

Map<AutofillIdSet<String>> getManuallyEnteredField()

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

int getNoSaveUiReason()

Returns the reason why a save dialog was not shown.

Set<String> getSelectedDatasetIds()

Returns which datasets were selected by the user.

Set<String> getShownDatasetIds()

Returns which datasets were shown to the user.

int getType()

Returns the type of the event.

int getUiType()

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

int hashCode()

Returns a hash code value for the object.

String toString()

Returns a string representation of the object.

Inherited methods

Constants

NO_SAVE_UI_REASON_DATASET_MATCH

Added in API level 31
public static final int NO_SAVE_UI_REASON_DATASET_MATCH

All fields matched contents of datasets.

Constant Value: 6 (0x00000006)

NO_SAVE_UI_REASON_FIELD_VALIDATION_FAILED

Added in API level 31
public static final int NO_SAVE_UI_REASON_FIELD_VALIDATION_FAILED

Fields failed validation.

Constant Value: 5 (0x00000005)

NO_SAVE_UI_REASON_HAS_EMPTY_REQUIRED

Added in API level 31
public static final int NO_SAVE_UI_REASON_HAS_EMPTY_REQUIRED

There was empty value for required ids.

Constant Value: 3 (0x00000003)

NO_SAVE_UI_REASON_NONE

Added in API level 31
public static final int NO_SAVE_UI_REASON_NONE

No reason for save dialog.

Constant Value: 0 (0x00000000)

NO_SAVE_UI_REASON_NO_SAVE_INFO

Added in API level 31
public static final int NO_SAVE_UI_REASON_NO_SAVE_INFO

The SaveInfo associated with the FillResponse is null.

Constant Value: 1 (0x00000001)

NO_SAVE_UI_REASON_NO_VALUE_CHANGED

Added in API level 31
public static final int NO_SAVE_UI_REASON_NO_VALUE_CHANGED

No value has been changed.

Constant Value: 4 (0x00000004)

NO_SAVE_UI_REASON_USING_CREDMAN

Added in API level 36
public static final int NO_SAVE_UI_REASON_USING_CREDMAN

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

Constant Value: 7 (0x00000007)

NO_SAVE_UI_REASON_WITH_DELAY_SAVE_FLAG

Added in API level 31
public static final int NO_SAVE_UI_REASON_WITH_DELAY_SAVE_FLAG

The service asked to delay save.

Constant Value: 2 (0x00000002)

TYPE_AUTHENTICATION_SELECTED

Added in API level 26
public static final int TYPE_AUTHENTICATION_SELECTED

A fill response authentication was selected.

Constant Value: 2 (0x00000002)

TYPE_CONTEXT_COMMITTED

Added in API level 28
public static final int TYPE_CONTEXT_COMMITTED

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 AutofillManager for more information about autofill contexts.

Constant Value: 4 (0x00000004)

TYPE_DATASETS_SHOWN

Added in API level 30
public static final int TYPE_DATASETS_SHOWN

A dataset selector was shown.

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

Constant Value: 5 (0x00000005)

TYPE_DATASET_AUTHENTICATION_SELECTED

Added in API level 26
public static final int TYPE_DATASET_AUTHENTICATION_SELECTED

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

Constant Value: 1 (0x00000001)

TYPE_DATASET_SELECTED

Added in API level 26
public static final int TYPE_DATASET_SELECTED

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

Note: on Android 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 Build.VERSION_CODES.O_MR1.

Constant Value: 0 (0x00000000)

TYPE_RESPONSE_DISCARDED

Added in API level 37
public static final int TYPE_RESPONSE_DISCARDED

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 ERROR(/android.service.personalcontext.PersonalContextManager) return non-null FillResponses, and one of them is discarded. OEMs can choose which FillResponse shall take the priority.

Constant Value: 7 (0x00000007)

TYPE_SAVE_SHOWN

Added in API level 26
public static final int TYPE_SAVE_SHOWN

A save UI was shown.

Constant Value: 3 (0x00000003)

TYPE_VIEW_REQUESTED_AUTOFILL

Added in API level 34
public static final int TYPE_VIEW_REQUESTED_AUTOFILL

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.

Constant Value: 6 (0x00000006)

UI_TYPE_CREDENTIAL_MANAGER

Added in API level 36
public static final int UI_TYPE_CREDENTIAL_MANAGER

Credential Manager suggestions are shown instead of Autofill suggestion

Constant Value: 4 (0x00000004)

UI_TYPE_DIALOG

Added in API level 33
public static final int UI_TYPE_DIALOG

The autofill suggestion is shown as a dialog presentation.

Constant Value: 3 (0x00000003)

UI_TYPE_INLINE

Added in API level 33
public static final int UI_TYPE_INLINE

The autofill suggestion is shown as a keyboard inline presentation.

Constant Value: 2 (0x00000002)

UI_TYPE_MENU

Added in API level 33
public static final int UI_TYPE_MENU

The autofill suggestion is shown as a menu popup presentation.

Constant Value: 1 (0x00000001)

UI_TYPE_UNKNOWN

Added in API level 33
public static final int UI_TYPE_UNKNOWN

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

Constant Value: 0 (0x00000000)

Public methods

equals

Added in API level 26
public boolean equals (Object o)

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
o Object: This value may be null.

Returns
boolean true if this object is the same as the obj argument; false otherwise.

getChangedFields

Added in API level 28
public Map<AutofillIdString> getChangedFields ()

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.

Returns
Map<AutofillIdString> 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
public Bundle getClientState ()

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.

Returns
Bundle This value may be null.

getDatasetId

Added in API level 26
public String getDatasetId ()

Returns the id of dataset the id was on.

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

getFieldsClassification

Added in API level 28
public Map<AutofillIdFieldClassification> getFieldsClassification ()

Gets the field classification results.

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

Returns
Map<AutofillIdFieldClassification> This value cannot be null.

getFocusedId

Added in API level 36
public AutofillId getFocusedId ()

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

Returns
AutofillId This value may be null.

getIgnoredDatasetIds

Added in API level 28
public Set<String> getIgnoredDatasetIds ()

Returns which datasets were NOT selected by the user.

Note: Only set on events of type TYPE_CONTEXT_COMMITTED.

Returns
Set<String> This value cannot be null.

getManuallyEnteredField

Added in API level 28
public Map<AutofillIdSet<String>> getManuallyEnteredField ()

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.

Returns
Map<AutofillIdSet<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
public int getNoSaveUiReason ()

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.

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

getSelectedDatasetIds

Added in API level 28
public Set<String> getSelectedDatasetIds ()

Returns which datasets were selected by the user.

Note: Only set on events of type TYPE_CONTEXT_COMMITTED.

Returns
Set<String> This value cannot be null.

getShownDatasetIds

Added in API level 36
public Set<String> getShownDatasetIds ()

Returns which datasets were shown to the user.

Note: Only set on events of type TYPE_DATASETS_SHOWN.

Returns
Set<String> This value cannot be null.

getType

Added in API level 26
public int getType ()

Returns the type of the event.

Returns
int The type of the event

getUiType

Added in API level 33
public int getUiType ()

Returns fill suggestion ui presentation type which corresponds to types defined in 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.

Returns
int The ui presentation type shown for user.
Value is one of the following:

hashCode

Added in API level 26
public int hashCode ()

Returns a hash code value for the object. This method is supported for the benefit of hash tables such as those provided by 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.

Returns
int a hash code value for this object.

toString

Added in API level 26
public String toString ()

Returns a string representation of the object.

Returns
String a string representation of the object.