Google is committed to advancing racial equity for Black communities. See how.

KeyedAppStatesCallback

public interface KeyedAppStatesCallback

androidx.enterprise.feedback.KeyedAppStatesCallback


Interface used to listen for the result when using KeyedAppStatesReporter.setStates(Collection, KeyedAppStatesCallback) or KeyedAppStatesReporter.setStatesImmediate(Collection, KeyedAppStatesCallback).

onResult(int, Throwable) will only only report errors which occur inside this app. If a failure occurs in the Device Policy Controller then this will not be reported.

STATUS_SUCCESS will be reported if the states are sent to all Device Policy Controllers.

Summary

Constants

int STATUS_EXCEEDED_BUFFER_ERROR

An error occurred because the local app buffer was exceeded.

int STATUS_SUCCESS

Used when the states have been sent to all eligible receivers.

int STATUS_TRANSACTION_TOO_LARGE_ERROR

An error has occurred because the transaction setting the states has exceeded the Android binder limit (1MB).

int STATUS_UNKNOWN_ERROR

Used when an error has occurred which stopped the states being set that isn't covered by the other error types.

Public methods

abstract void onResult(int state, Throwable throwable)

Called either when an error happens in this app, or when the states have been sent to all eligible receivers.

Constants

STATUS_EXCEEDED_BUFFER_ERROR

public static final int STATUS_EXCEEDED_BUFFER_ERROR

An error occurred because the local app buffer was exceeded. This means too many setState or setStateImmediate calls have been made without a connection to the DPC being formed.

Constant Value: 3 (0x00000003)

STATUS_SUCCESS

public static final int STATUS_SUCCESS

Used when the states have been sent to all eligible receivers.

If there are 0 eligible receivers on the device, then this will be recorded as success.

Constant Value: 0 (0x00000000)

STATUS_TRANSACTION_TOO_LARGE_ERROR

public static final int STATUS_TRANSACTION_TOO_LARGE_ERROR

An error has occurred because the transaction setting the states has exceeded the Android binder limit (1MB). This can occur because the app is filling up the 1MB limit with other IPC calls, or because the size or number of states being set is too large.

Constant Value: 2 (0x00000002)

STATUS_UNKNOWN_ERROR

public static final int STATUS_UNKNOWN_ERROR

Used when an error has occurred which stopped the states being set that isn't covered by the other error types.

Constant Value: 1 (0x00000001)

Public methods

onResult

public abstract void onResult (int state, 
                Throwable throwable)

Called either when an error happens in this app, or when the states have been sent to all eligible receivers.

If there is an error, this will be called with the first error encountered.

If there are 0 eligible receivers on the device, then this will be recorded as success.

Parameters
state int

throwable Throwable