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 |
static Int |
Response code for the |
static Int |
Response code for the |
static Int |
Response code for the |
static Int |
Response code for the |
static Int |
Value is |
static Int |
The identifier of |
static Int |
The identifier of |
static Int |
The identifier of the action returned by |
static Int |
The identifier of |
static Int |
The identifier of |
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 |
open String |
The identifier of the |
static Boolean |
isValidResponse(response: Int) |
Constants
RESPONSE_CHALLENGE_ACK
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
RESPONSE_CHALLENGE_PASSPHRASE
static val RESPONSE_CHALLENGE_PASSPHRASE: Int
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 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: 5
RESPONSE_CHALLENGE_PIN
static val RESPONSE_CHALLENGE_PIN: Int
Response code for the consumer
in ControlsProviderService.performControlAction
indicating that in order for the action to be performed, a PIN is required.
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: 4
RESPONSE_FAIL
static val RESPONSE_FAIL: Int
Response code for the consumer
in ControlsProviderService.performControlAction
indicating that the action has failed.
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: 2
RESPONSE_OK
static val RESPONSE_OK: Int
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 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: 1
RESPONSE_UNKNOWN
static val RESPONSE_UNKNOWN: 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
Value: 0
TYPE_BOOLEAN
static val TYPE_BOOLEAN: Int
The identifier of BooleanAction
.
Value is android.service.controls.actions.ControlAction#TYPE_ERROR
, android.service.controls.actions.ControlAction#TYPE_BOOLEAN
, android.service.controls.actions.ControlAction#TYPE_FLOAT
, android.service.controls.actions.ControlAction#TYPE_MODE
, or android.service.controls.actions.ControlAction#TYPE_COMMAND
Value: 1
TYPE_COMMAND
static val TYPE_COMMAND: Int
The identifier of CommandAction
.
Value is android.service.controls.actions.ControlAction#TYPE_ERROR
, android.service.controls.actions.ControlAction#TYPE_BOOLEAN
, android.service.controls.actions.ControlAction#TYPE_FLOAT
, android.service.controls.actions.ControlAction#TYPE_MODE
, or android.service.controls.actions.ControlAction#TYPE_COMMAND
Value: 5
TYPE_ERROR
static val TYPE_ERROR: Int
The identifier of the action returned by getErrorAction
.
Value is android.service.controls.actions.ControlAction#TYPE_ERROR
, android.service.controls.actions.ControlAction#TYPE_BOOLEAN
, android.service.controls.actions.ControlAction#TYPE_FLOAT
, android.service.controls.actions.ControlAction#TYPE_MODE
, or android.service.controls.actions.ControlAction#TYPE_COMMAND
Value: -1
TYPE_FLOAT
static val TYPE_FLOAT: Int
The identifier of FloatAction
.
Value is android.service.controls.actions.ControlAction#TYPE_ERROR
, android.service.controls.actions.ControlAction#TYPE_BOOLEAN
, android.service.controls.actions.ControlAction#TYPE_FLOAT
, android.service.controls.actions.ControlAction#TYPE_MODE
, or android.service.controls.actions.ControlAction#TYPE_COMMAND
Value: 2
TYPE_MODE
static val TYPE_MODE: Int
The identifier of ModeAction
.
Value is android.service.controls.actions.ControlAction#TYPE_ERROR
, android.service.controls.actions.ControlAction#TYPE_BOOLEAN
, android.service.controls.actions.ControlAction#TYPE_FLOAT
, android.service.controls.actions.ControlAction#TYPE_MODE
, or android.service.controls.actions.ControlAction#TYPE_COMMAND
Value: 4
Public methods
getActionType
abstract fun getActionType(): Int
The action type associated with this class.
getChallengeValue
open fun getChallengeValue(): String?
The challenge value used to authenticate certain actions, if available.
Return | |
---|---|
String? |
This value may be null . |
getErrorAction
open static fun getErrorAction(): ControlAction
Returns a singleton ControlAction
used for indicating an error in unparceling.
Return | |
---|---|
ControlAction |
This value cannot be null . |
getTemplateId
open fun getTemplateId(): String
The identifier of the ControlTemplate
that originated this action
Return | |
---|---|
String |
This value cannot be null . |
isValidResponse
static fun isValidResponse(response: Int): Boolean