# Print output for @column tags ?>
Developers

- Design
- Develop
- Distribute

Developer Console

## Most visited

## Recently visited

## Results for

Summary: Constants | Methods | Inherited Methods

# ControlAction

`public abstract class ControlAction`
`extends Object` ``

java.lang.Object
↳ | android.service.controls.actions.ControlAction

Known direct subclasses BooleanAction, CommandAction, FloatAction, ModeAction
BooleanAction | Action sent by user toggling a `Control` between checked/unchecked.
CommandAction | A simple `ControlAction` indicating that the user has interacted with a `Control` created using a `StatelessTemplate`.
FloatAction | Action sent by a `RangeTemplate`, `ToggleRangeTemplate`.
ModeAction | Action sent by the user to indicate a change of mode.

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:

- `RESPONSE_CHALLENGE_ACK`
- `RESPONSE_CHALLENGE_PIN`
- `RESPONSE_CHALLENGE_PASSPHRASE`

## 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 `RESPONSE_UNKNOWN`, `RESPONSE_OK`, `RESPONSE_FAIL`, `RESPONSE_CHALLENGE_ACK`, `RESPONSE_CHALLENGE_PIN`, or `RESPONSE_CHALLENGE_PASSPHRASE`
`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 `ActionType` 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
From class `java.lang.Object`
`Object` | `clone()` Creates and returns a copy of this object.
`boolean` | `equals(Object obj)` Indicates whether some other object is "equal to" this one.
`void` | `finalize()` Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.
`final Class<?>` | `getClass()` Returns the runtime class of this `Object`.
`int` | `hashCode()` Returns a hash code value for the object.
`final void` | `notify()` Wakes up a single thread that is waiting on this object's monitor.
`final void` | `notifyAll()` Wakes up all threads that are waiting on this object's monitor.
`String` | `toString()` Returns a string representation of the object.
`final void` | `wait(long timeout, int nanos)` Causes the current thread to wait until another thread invokes the `notify()` method or the `notifyAll()` method for this object, or some other thread interrupts the current thread, or a certain amount of real time has elapsed.
`final void` | `wait(long timeout)` Causes the current thread to wait until either another thread invokes the `notify()` method or the `notifyAll()` method for this object, or a specified amount of time has elapsed.
`final void` | `wait()` Causes the current thread to wait until another thread invokes the `notify()` method or the `notifyAll()` method for this object.

## Constants

### RESPONSE_CHALLENGE_ACK

    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 `RESPONSE_UNKNOWN`, `RESPONSE_OK`, `RESPONSE_FAIL`, `RESPONSE_CHALLENGE_ACK`, `RESPONSE_CHALLENGE_PIN`, or `RESPONSE_CHALLENGE_PASSPHRASE`

Constant Value: 3 (0x00000003)

### RESPONSE_CHALLENGE_PASSPHRASE

    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 `RESPONSE_UNKNOWN`, `RESPONSE_OK`, `RESPONSE_FAIL`, `RESPONSE_CHALLENGE_ACK`, `RESPONSE_CHALLENGE_PIN`, or `RESPONSE_CHALLENGE_PASSPHRASE`

Constant Value: 5 (0x00000005)

### RESPONSE_CHALLENGE_PIN

    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 `RESPONSE_UNKNOWN`, `RESPONSE_OK`, `RESPONSE_FAIL`, `RESPONSE_CHALLENGE_ACK`, `RESPONSE_CHALLENGE_PIN`, or `RESPONSE_CHALLENGE_PASSPHRASE`

Constant Value: 4 (0x00000004)

### RESPONSE_FAIL

    public static final int RESPONSE_FAIL

Response code for the `consumer` in `ControlsProviderService#performControlAction` indicating that the action has failed.
Value is `RESPONSE_UNKNOWN`, `RESPONSE_OK`, `RESPONSE_FAIL`, `RESPONSE_CHALLENGE_ACK`, `RESPONSE_CHALLENGE_PIN`, or `RESPONSE_CHALLENGE_PASSPHRASE`

Constant Value: 2 (0x00000002)

### RESPONSE_OK

    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 `RESPONSE_UNKNOWN`, `RESPONSE_OK`, `RESPONSE_FAIL`, `RESPONSE_CHALLENGE_ACK`, `RESPONSE_CHALLENGE_PIN`, or `RESPONSE_CHALLENGE_PASSPHRASE`

Constant Value: 1 (0x00000001)

### RESPONSE_UNKNOWN

    public static final int RESPONSE_UNKNOWN

Value is `RESPONSE_UNKNOWN`, `RESPONSE_OK`, `RESPONSE_FAIL`, `RESPONSE_CHALLENGE_ACK`, `RESPONSE_CHALLENGE_PIN`, or `RESPONSE_CHALLENGE_PASSPHRASE`

Constant Value: 0 (0x00000000)

### TYPE_BOOLEAN

    public static final int TYPE_BOOLEAN

The identifier of `BooleanAction`.
Value is `TYPE_ERROR`, `TYPE_BOOLEAN`, `TYPE_FLOAT`, `TYPE_MODE`, or `TYPE_COMMAND`

Constant Value: 1 (0x00000001)

### TYPE_COMMAND

    public static final int TYPE_COMMAND

The identifier of `CommandAction`.
Value is `TYPE_ERROR`, `TYPE_BOOLEAN`, `TYPE_FLOAT`, `TYPE_MODE`, or `TYPE_COMMAND`

Constant Value: 5 (0x00000005)

### TYPE_ERROR

    public static final int TYPE_ERROR

The identifier of the action returned by `getErrorAction()`.
Value is `TYPE_ERROR`, `TYPE_BOOLEAN`, `TYPE_FLOAT`, `TYPE_MODE`, or `TYPE_COMMAND`

Constant Value: -1 (0xffffffff)

### TYPE_FLOAT

    public static final int TYPE_FLOAT

The identifier of `FloatAction`.
Value is `TYPE_ERROR`, `TYPE_BOOLEAN`, `TYPE_FLOAT`, `TYPE_MODE`, or `TYPE_COMMAND`

Constant Value: 2 (0x00000002)

### TYPE_MODE

    public static final int TYPE_MODE

The identifier of `ModeAction`.
Value is `TYPE_ERROR`, `TYPE_BOOLEAN`, `TYPE_FLOAT`, `TYPE_MODE`, or `TYPE_COMMAND`

Constant Value: 4 (0x00000004)

## Public methods

### getActionType

    public abstract int getActionType ()

The `ActionType` associated with this class.

Returns
`int` | Value is `TYPE_ERROR`, `TYPE_BOOLEAN`, `TYPE_FLOAT`, `TYPE_MODE`, or `TYPE_COMMAND`

### getChallengeValue

    public String getChallengeValue ()

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

Returns
`String` | This value may be `null`.

### getErrorAction

    public static ControlAction getErrorAction ()

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

Returns
`ControlAction` | This value cannot be `null`.

### getTemplateId

    public String getTemplateId ()

The identifier of the `ControlTemplate` that originated this action

Returns
`String` | This value cannot be `null`.

### isValidResponse

    public static final boolean isValidResponse (int response)

Parameters
`response` | `int`: Value is `RESPONSE_UNKNOWN`, `RESPONSE_OK`, `RESPONSE_FAIL`, `RESPONSE_CHALLENGE_ACK`, `RESPONSE_CHALLENGE_PIN`, or `RESPONSE_CHALLENGE_PASSPHRASE`

Returns
`boolean` |

Full name *
Email address *
Company / developer name
One of your Play Store app URLs *
Which best describes your business:*
Apps
Games
Apps & Games
*
*