Added in API level 31

SavedDatasetsInfoCallback


public interface SavedDatasetsInfoCallback

android.service.autofill.SavedDatasetsInfoCallback


Handles the response to AutofillService#onSavedDatasetsInfoRequest(SavedDatasetsInfoCallback).

Use onSuccess(java.util.Set) to return the computed info about the datasets the user saved to this service. If there was an error querying the info, or if the service is unable to do so at this time (for example, if the user isn't logged in), call onError(int).

This callback can be used only once.

Summary

Constants

int ERROR_NEEDS_USER_ACTION

The result cannot be computed until the user takes some action, such as setting up their account.

int ERROR_OTHER

The result could not be computed for any other reason.

int ERROR_UNSUPPORTED

The service does not support this request.

Public methods

abstract void onError(int error)

Respond to the request with an error.

abstract void onSuccess(Set<SavedDatasetsInfo> results)

Successfully respond to the request with the info on each type of saved datasets.

Constants

ERROR_NEEDS_USER_ACTION

Added in API level 31
public static final int ERROR_NEEDS_USER_ACTION

The result cannot be computed until the user takes some action, such as setting up their account.

Constant Value: 2 (0x00000002)

ERROR_OTHER

Added in API level 31
public static final int ERROR_OTHER

The result could not be computed for any other reason.

Constant Value: 0 (0x00000000)

ERROR_UNSUPPORTED

Added in API level 31
public static final int ERROR_UNSUPPORTED

The service does not support this request.

Constant Value: 1 (0x00000001)

Public methods

onError

Added in API level 31
public abstract void onError (int error)

Respond to the request with an error. System settings may display a suitable notice to the user.

Parameters
error int: Value is ERROR_OTHER, ERROR_UNSUPPORTED, or ERROR_NEEDS_USER_ACTION

onSuccess

Added in API level 31
public abstract void onSuccess (Set<SavedDatasetsInfo> results)

Successfully respond to the request with the info on each type of saved datasets.

Parameters
results Set: This value cannot be null.