# Print output for @column tags ?>
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:
Constants | |
---|---|
int |
RESPONSE_CHALLENGE_ACK
Response code for the |
int |
RESPONSE_CHALLENGE_PASSPHRASE
Response code for the |
int |
RESPONSE_CHALLENGE_PIN
Response code for the |
int |
RESPONSE_FAIL
Response code for the |
int |
RESPONSE_OK
Response code for the |
int |
RESPONSE_UNKNOWN
Value is |
int |
TYPE_BOOLEAN
The identifier of |
int |
TYPE_COMMAND
The identifier of |
int |
TYPE_ERROR
The identifier of the action returned by |
int |
TYPE_FLOAT
The identifier of |
int |
TYPE_MODE
The identifier of |
Public methods | |
---|---|
abstract
int
|
getActionType()
The |
String
|
getChallengeValue()
The challenge value used to authenticate certain actions, if available. |
static
ControlAction
|
getErrorAction()
Returns a singleton |
String
|
getTemplateId()
The identifier of the |
static
final
boolean
|
isValidResponse(int response)
|
Inherited methods | |
---|---|
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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 abstract int getActionType ()
The ActionType
associated with this class.
Returns | |
---|---|
int |
Value is TYPE_ERROR , TYPE_BOOLEAN , TYPE_FLOAT , TYPE_MODE , or TYPE_COMMAND |
public String getChallengeValue ()
The challenge value used to authenticate certain actions, if available.
Returns | |
---|---|
String |
This value may be null . |
public static ControlAction getErrorAction ()
Returns a singleton ControlAction
used for indicating an error in unparceling.
Returns | |
---|---|
ControlAction |
This value cannot be null . |
public String getTemplateId ()
The identifier of the ControlTemplate
that originated this action
Returns | |
---|---|
String |
This value cannot be null . |
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 |