KeyedAppState

abstract class KeyedAppState
kotlin.Any
   ↳ androidx.enterprise.feedback.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 classes

abstract

The builder for KeyedAppState.

Constants

static Int

The maximum length of the data field.

static Int

The maximum length of the key.

static Int

The maximum length of the message field.

static Int

static Int

Public methods

open static KeyedAppState.KeyedAppStateBuilder

Create a KeyedAppStateBuilder.

abstract String?

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

abstract String

The key for the app state.

abstract String?

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

abstract Int

The severity of the app state.

Constants

MAX_DATA_LENGTH

static val MAX_DATA_LENGTH: Int

The maximum length of the data field.

Value: 1000

MAX_KEY_LENGTH

static val MAX_KEY_LENGTH: Int

The maximum length of the key.

Value: 100

MAX_MESSAGE_LENGTH

static val MAX_MESSAGE_LENGTH: Int

The maximum length of the message field.

Value: 1000

SEVERITY_ERROR

static val SEVERITY_ERROR: Int
Value: 2

SEVERITY_INFO

static val SEVERITY_INFO: Int
Value: 1

Public methods

builder

@NonNull open static fun builder(): KeyedAppState.KeyedAppStateBuilder

Create a KeyedAppStateBuilder.

getData

@Nullable abstract fun getData(): String?

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

@NonNull abstract fun getKey(): String

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.

getMessage

@Nullable abstract fun getMessage(): String?

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

abstract fun getSeverity(): Int

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.