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 android.service.controls.actions.ControlAction#RESPONSE_UNKNOWN, android.service.controls.actions.ControlAction#RESPONSE_OK, android.service.controls.actions.ControlAction#RESPONSE_FAIL, android.service.controls.actions.ControlAction#RESPONSE_CHALLENGE_ACK, android.service.controls.actions.ControlAction#RESPONSE_CHALLENGE_PIN, or android.service.controls.actions.ControlAction#RESPONSE_CHALLENGE_PASSPHRASE

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 android.service.controls.actions.ControlAction#RESPONSE_UNKNOWN, android.service.controls.actions.ControlAction#RESPONSE_OK, android.service.controls.actions.ControlAction#RESPONSE_FAIL, android.service.controls.actions.ControlAction#RESPONSE_CHALLENGE_ACK, android.service.controls.actions.ControlAction#RESPONSE_CHALLENGE_PIN, or android.service.controls.actions.ControlAction#RESPONSE_CHALLENGE_PASSPHRASE

Value: 3

Public methods

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.