Added in API level 30

ControlAction


abstract class ControlAction
kotlin.Any
   ↳ android.service.controls.actions.ControlAction

An abstract action indicating a user interaction with a Control. In some cases, an action needs to be validated by the user, using a password, PIN or simple acknowledgment. For those cases, an optional (nullable) parameter can be passed to send the user input. This challenge value will be requested from the user and sent as part of a ControlAction only if the service has responded to an action with one of:

Summary

Constants
static Int

Response code for the consumer in ControlsProviderService.performControlAction indicating that in order for the action to be performed, acknowledgment from the user is required.

static Int

Response code for the consumer in ControlsProviderService.performControlAction indicating that in order for the action to be performed, an alphanumeric passphrase is required.

static Int

Response code for the consumer in ControlsProviderService.performControlAction indicating that in order for the action to be performed, a PIN is required.

static Int

Response code for the consumer in ControlsProviderService.performControlAction indicating that the action has failed.

static Int

Response code for the consumer in ControlsProviderService.performControlAction indicating that the action has been performed.

static Int

Value is one of the following:

static Int

The identifier of BooleanAction.

static Int

The identifier of CommandAction.

static Int

The identifier of the action returned by getErrorAction.

static Int

The identifier of FloatAction.

static Int

The identifier of ModeAction.

Public methods
abstract Int

The action type associated with this class.

open String?

The challenge value used to authenticate certain actions, if available.

open static ControlAction

Returns a singleton ControlAction used for indicating an error in unparceling.

open String

The identifier of the ControlTemplate that originated this action

static Boolean
isValidResponse(response: Int)

Constants

RESPONSE_CHALLENGE_ACK

Added in API level 30
static val RESPONSE_CHALLENGE_ACK: Int

Response code for the consumer in ControlsProviderService.performControlAction indicating that in order for the action to be performed, acknowledgment from the user is required. Any non-empty string returned from getChallengeValue shall be treated as a positive acknowledgment.
Value is one of the following:

Value: 3

RESPONSE_CHALLENGE_PASSPHRASE

Added in API level 30
static val RESPONSE_CHALLENGE_PASSPHRASE: Int

Response code for the consumer in ControlsProviderService.performControlAction indicating that in order for the action to be performed, an alphanumeric passphrase is required.
Value is one of the following:

Value: 5

RESPONSE_CHALLENGE_PIN

Added in API level 30
static val RESPONSE_CHALLENGE_PIN: Int

Response code for the consumer in ControlsProviderService.performControlAction indicating that in order for the action to be performed, a PIN is required.
Value is one of the following:

Value: 4

RESPONSE_FAIL

Added in API level 30
static val RESPONSE_FAIL: Int

Response code for the consumer in ControlsProviderService.performControlAction indicating that the action has failed.
Value is one of the following:

Value: 2

RESPONSE_OK

Added in API level 30
static val RESPONSE_OK: Int

Response code for the consumer in ControlsProviderService.performControlAction indicating that the action has been performed. The action may still fail later and the state may not change.
Value is one of the following:

Value: 1

RESPONSE_UNKNOWN

Added in API level 30
static val RESPONSE_UNKNOWN: Int

Value is one of the following:

Value: 0

TYPE_BOOLEAN

Added in API level 30
static val TYPE_BOOLEAN: Int

The identifier of BooleanAction.
Value is one of the following:

Value: 1

TYPE_COMMAND

Added in API level 30
static val TYPE_COMMAND: Int

The identifier of CommandAction.
Value is one of the following:

Value: 5

TYPE_ERROR

Added in API level 30
static val TYPE_ERROR: Int

The identifier of the action returned by getErrorAction.
Value is one of the following:

Value: -1

TYPE_FLOAT

Added in API level 30
static val TYPE_FLOAT: Int

The identifier of FloatAction.
Value is one of the following:

Value: 2

TYPE_MODE

Added in API level 30
static val TYPE_MODE: Int

The identifier of ModeAction.
Value is one of the following:

Value: 4

Public methods

getActionType

Added in API level 30
abstract fun getActionType(): Int

The action type associated with this class.

Return
Int Value is one of the following:

getChallengeValue

Added in API level 30
open fun getChallengeValue(): String?

The challenge value used to authenticate certain actions, if available.

Return
String? This value may be null.

getErrorAction

Added in API level 30
open static fun getErrorAction(): ControlAction

Returns a singleton ControlAction used for indicating an error in unparceling.

Return
ControlAction This value cannot be null.

getTemplateId

Added in API level 30
open fun getTemplateId(): String

The identifier of the ControlTemplate that originated this action

Return
String This value cannot be null.

isValidResponse

Added in API level 30
static fun isValidResponse(response: Int): Boolean
Parameters
response Int: Value is one of the following: