Added in API level 37

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

Added in API level 37
static val READ_SCREEN_CONTEXT_REQUEST_STATE_GRANTED: Int

Read screen context access is granted.

Value: 0

READ_SCREEN_CONTEXT_REQUEST_STATE_REQUESTABLE

Added in API level 37
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: 1

READ_SCREEN_CONTEXT_REQUEST_STATE_UNREQUESTABLE

Added in API level 37
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: 2

Public methods

canReadScreenContext

Added in API level 37
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

Added in API level 37
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

Added in API level 37
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: