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 |
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 action type associated with this class. |
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 | |
---|---|
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 action type 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 |