VoiceInteractionManager
class VoiceInteractionManager
| kotlin.Any | |
| ↳ | android.app.voiceinteraction.VoiceInteractionManager |
Service that provides information about and interacts with the current global voice interactor
Summary
| Constants | |
|---|---|
| static Int |
Read screen context access is granted. |
| static Int |
Read screen context access isn't granted, but apps can request access. |
| static Int |
Read screen context access is denied, and can't be requested with dialog by apps. |
| Public methods | |
|---|---|
| Boolean |
Returns whether the calling app can read screen context. |
| Intent |
Creates an intent which can be used to request access to screen context for current assistant role holder. |
| Int |
Returns the read screen context request state for an app. |
Constants
READ_SCREEN_CONTEXT_REQUEST_STATE_GRANTED
static val READ_SCREEN_CONTEXT_REQUEST_STATE_GRANTED: Int
Read screen context access is granted.
Value: 0See Also
READ_SCREEN_CONTEXT_REQUEST_STATE_REQUESTABLE
static val READ_SCREEN_CONTEXT_REQUEST_STATE_REQUESTABLE: Int
Read screen context access isn't granted, but apps can request access. When the app request access, user will be prompted with request dialog to grant or deny the request.
Value: 1See Also
READ_SCREEN_CONTEXT_REQUEST_STATE_UNREQUESTABLE
static val READ_SCREEN_CONTEXT_REQUEST_STATE_UNREQUESTABLE: Int
Read screen context access is denied, and can't be requested with dialog by apps. Access request will be automatically denied by the system, preventing the request dialog from being displayed to the user.
Value: 2See Also
Public methods
canReadScreenContext
fun canReadScreenContext(): Boolean
Returns whether the calling app can read screen context.
| Return | |
|---|---|
Boolean |
true if the calling app is the current assistant and has access to screen context , false otherwise. |
createRequestReadScreenContextIntent
fun createRequestReadScreenContextIntent(): Intent
Creates an intent which can be used to request access to screen context for current assistant role holder. This intent MUST be used with android.app.Activity#startActivityForResult. The result code of the activity will be android.app.Activity#RESULT_OK if the request was granted, android.app.Activity#RESULT_CANCELED if not. If the caller is not the current default assistant, the request will be denied automatically.
| Return | |
|---|---|
Intent |
The created intent. This value cannot be null. |
getReadScreenContextRequestState
fun getReadScreenContextRequestState(): Int
Returns the read screen context request state for an app. This method provides a streamlined mechanism for applications to determine whether read screen context access can be requested (i.e. whether the user will be prompted with a request dialog).
| Return | |
|---|---|
Int |
The current request state of the specified access, represented by one of the following constants: READ_SCREEN_CONTEXT_REQUEST_STATE_GRANTED, READ_SCREEN_CONTEXT_REQUEST_STATE_REQUESTABLE, or READ_SCREEN_CONTEXT_REQUEST_STATE_UNREQUESTABLE Value is one of the following: |