ControlAction


public abstract class ControlAction
extends Object

java.lang.Object
   ↳ 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

int RESPONSE_CHALLENGE_ACK

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

int RESPONSE_CHALLENGE_PASSPHRASE

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

int RESPONSE_CHALLENGE_PIN

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

int RESPONSE_FAIL

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

int RESPONSE_OK

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

int RESPONSE_UNKNOWN

Value is one of the following:

int TYPE_BOOLEAN

The identifier of BooleanAction.

int TYPE_COMMAND

The identifier of CommandAction.

int TYPE_ERROR

The identifier of the action returned by getErrorAction().

int TYPE_FLOAT

The identifier of FloatAction.

int TYPE_MODE

The identifier of ModeAction.

Public methods

abstract int getActionType()

The action type associated with this class.

String getChallengeValue()

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

static ControlAction getErrorAction()

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

String getTemplateId()

The identifier of the ControlTemplate that originated this action

static final boolean isValidResponse(int response)

Inherited methods

Constants

RESPONSE_CHALLENGE_ACK

Added in API level 30
public static final int RESPONSE_CHALLENGE_ACK

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:

RESPONSE_CHALLENGE_PASSPHRASE

Added in API level 30
public static final int RESPONSE_CHALLENGE_PASSPHRASE

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:

RESPONSE_CHALLENGE_PIN

Added in API level 30
public static final int RESPONSE_CHALLENGE_PIN

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:

RESPONSE_FAIL

Added in API level 30
public static final int RESPONSE_FAIL

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

RESPONSE_OK

Added in API level 30
public static final int RESPONSE_OK

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:

RESPONSE_UNKNOWN

Added in API level 30
public static final int RESPONSE_UNKNOWN

Value is one of the following:

TYPE_BOOLEAN

Added in API level 30
public static final int TYPE_BOOLEAN

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

TYPE_COMMAND

Added in API level 30
public static final int TYPE_COMMAND

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

TYPE_ERROR

Added in API level 30
public static final int TYPE_ERROR

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

TYPE_FLOAT

Added in API level 30
public static final int TYPE_FLOAT

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

TYPE_MODE

Added in API level 30
public static final int TYPE_MODE

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

Public methods

getActionType

Added in API level 30
public abstract int getActionType ()

The action type associated with this class.

Returns
int Value is one of the following:

getChallengeValue

Added in API level 30
public String getChallengeValue ()

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

Returns
String This value may be null.

getErrorAction

Added in API level 30
public static ControlAction getErrorAction ()

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

Returns
ControlAction This value cannot be null.

getTemplateId

Added in API level 30
public String getTemplateId ()

The identifier of the ControlTemplate that originated this action

Returns
String This value cannot be null.

isValidResponse

Added in API level 30
public static final boolean isValidResponse (int response)

Parameters
response int: Value is one of the following:
Returns
boolean