It's happening now, watch the livestream.

SingletonKeyedAppStatesReporter

public class SingletonKeyedAppStatesReporter
extends KeyedAppStatesReporter

java.lang.Object
   ↳ androidx.enterprise.feedback.KeyedAppStatesReporter
     ↳ androidx.enterprise.feedback.SingletonKeyedAppStatesReporter


A KeyedAppStatesReporter that only allows a single instance to exist at one time, avoiding repeated instantiations.

Summary

Public methods

static KeyedAppStatesReporter getInstance(Context context)

Returns an instance of the reporter.

static void initialize(Context context, Executor executor)

Sets executor used to construct the singleton.

void setStates(Collection<KeyedAppState> states)

Set app states to be sent to an EMM (enterprise mobility management).

void setStatesImmediate(Collection<KeyedAppState> states)

Performs the same function as setStates(Collection), except it also requests that the states are immediately uploaded to be accessible via server APIs.

Inherited methods

Public methods

getInstance

public static KeyedAppStatesReporter getInstance (Context context)

Returns an instance of the reporter.

Creates and initializes an instance if one doesn't already exist.

Parameters
context Context

Returns
KeyedAppStatesReporter

initialize

public static void initialize (Context context, 
                Executor executor)

Sets executor used to construct the singleton.

If required, this method must be called before calling getInstance(Context).

If this method is not called, the reporter will run on a newly-created thread. This newly-created thread will be cleaned up and recreated as necessary when idle.

Parameters
context Context

executor Executor

setStates

public void setStates (Collection<KeyedAppState> states)

Set app states to be sent to an EMM (enterprise mobility management). The EMM can then display this information to the management organization.

Do not send personally-identifiable information with this method.

Each provided keyed app state will replace any previously set keyed app states with the same key for this package name.

If multiple keyed app states are set with the same key, only one will be received by the EMM. Which will be received is not defined.

This information is sent immediately to all device owner and profile owner apps on the device. It is also sent immediately to the app with package name com.android.vending if it exists, which is the Play Store on GMS devices.

EMMs can access these states either directly in a custom DPC (device policy manager), via Android Management APIs, or via Play EMM APIs.

Parameters
states Collection

setStatesImmediate

public void setStatesImmediate (Collection<KeyedAppState> states)

Performs the same function as setStates(Collection), except it also requests that the states are immediately uploaded to be accessible via server APIs.

The receiver is not obligated to meet this immediate upload request. For example, Play and Android Management APIs have daily quotas.

Parameters
states Collection