KeyedAppState


@AutoValue
public abstract class KeyedAppState


A keyed app state to be sent to an EMM (enterprise mobility management), with the intention that it is displayed to the management organization.

Summary

Nested types

The builder for KeyedAppState.

Constants

static final int

This field is deprecated.

Use getMaxDataLength

static final int

This field is deprecated.

Use getMaxKeyLength

static final int

This field is deprecated.

Use getMaxMessageLength

static final int
static final int

Public methods

static @NonNull KeyedAppState.KeyedAppStateBuilder

Create a KeyedAppStateBuilder.

abstract @Nullable String

Optionally, a machine-readable value to be read by the EMM.

abstract @NonNull String

The key for the app state.

static final int

Get the maximum length of getData.

static final int

Get the maximum length of getKey.

static final int

Get the maximum length of getMessage.

abstract @Nullable String

Optionally, a free-form message string to explain the app state.

abstract int

The severity of the app state.

Constants

MAX_DATA_LENGTH

Added in 1.0.0
Deprecated in 1.1.0-rc01
public static final int MAX_DATA_LENGTH = 1000

MAX_KEY_LENGTH

Added in 1.0.0
Deprecated in 1.1.0-rc01
public static final int MAX_KEY_LENGTH = 100

MAX_MESSAGE_LENGTH

Added in 1.0.0
Deprecated in 1.1.0-rc01
public static final int MAX_MESSAGE_LENGTH = 1000

SEVERITY_ERROR

Added in 1.0.0
public static final int SEVERITY_ERROR = 2

SEVERITY_INFO

Added in 1.0.0
public static final int SEVERITY_INFO = 1

Public methods

builder

Added in 1.0.0
public static @NonNull KeyedAppState.KeyedAppStateBuilder builder()

Create a KeyedAppStateBuilder.

getData

Added in 1.0.0
public abstract @Nullable String getData()

Optionally, a machine-readable value to be read by the EMM. For example, setting values that the admin can choose to query against in the EMM console (e.g. “notify me if the battery_warning data <10”).

getKey

Added in 1.0.0
public abstract @NonNull String getKey()

The key for the app state. Acts as a point of reference for what the app is providing state for. For example, when providing managed configuration feedback, this key could be the managed configuration key to allow EMMs to take advantage of the connection in their UI.

getMaxDataLength

Added in 1.1.0-rc01
public static final int getMaxDataLength()

Get the maximum length of getData.

getMaxKeyLength

Added in 1.1.0-rc01
public static final int getMaxKeyLength()

Get the maximum length of getKey.

getMaxMessageLength

Added in 1.1.0-rc01
public static final int getMaxMessageLength()

Get the maximum length of getMessage.

getMessage

Added in 1.0.0
public abstract @Nullable String getMessage()

Optionally, a free-form message string to explain the app state. If the state was triggered by a particular value (e.g. a managed configuration value), it should be included in the message.

getSeverity

Added in 1.0.0
public abstract int getSeverity()

The severity of the app state. This allows EMMs to choose to notify admins of errors. This should only be set to SEVERITY_ERROR for genuine error conditions that a management organization needs to take action to fix.

When sending an app state containing errors, it is critical that follow-up app states are sent when the errors have been resolved, using the same key and this value set to SEVERITY_INFO.