Added in [API level 37](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels) Summary: [Constants](https://developer.android.com/reference/android/app/voiceinteraction/VoiceInteractionManager#constants) \| [Methods](https://developer.android.com/reference/android/app/voiceinteraction/VoiceInteractionManager#pubmethods) \| [Inherited Methods](https://developer.android.com/reference/android/app/voiceinteraction/VoiceInteractionManager#inhmethods)

# VoiceInteractionManager

*** ** * ** ***

` public final class VoiceInteractionManager `   
` extends https://developer.android.com/reference/java/lang/Object ` ` `

|---|---|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object) ||
| ↳ | android.app.voiceinteraction.VoiceInteractionManager |

<br />

*** ** * ** ***

Service that provides information about and interacts with the current global voice interactor

## Summary

| ### Constants ||
|---|---|
| `int` | `https://developer.android.com/reference/android/app/voiceinteraction/VoiceInteractionManager#READ_SCREEN_CONTEXT_REQUEST_STATE_GRANTED` Read screen context access is granted. |
| `int` | `https://developer.android.com/reference/android/app/voiceinteraction/VoiceInteractionManager#READ_SCREEN_CONTEXT_REQUEST_STATE_REQUESTABLE` Read screen context access isn't granted, but apps can request access. |
| `int` | `https://developer.android.com/reference/android/app/voiceinteraction/VoiceInteractionManager#READ_SCREEN_CONTEXT_REQUEST_STATE_UNREQUESTABLE` Read screen context access is denied, and can't be requested with dialog by apps. |

| ### Public methods ||
|---|---|
| ` boolean` | ` https://developer.android.com/reference/android/app/voiceinteraction/VoiceInteractionManager#canReadScreenContext()() ` Returns whether the calling app can read screen context. |
| ` https://developer.android.com/reference/android/content/Intent` | ` https://developer.android.com/reference/android/app/voiceinteraction/VoiceInteractionManager#createRequestReadScreenContextIntent()() ` Creates an intent which can be used to request access to screen context for current assistant role holder. |
| ` int` | ` https://developer.android.com/reference/android/app/voiceinteraction/VoiceInteractionManager#getReadScreenContextRequestState()() ` Returns the read screen context request state for an app. |

### Inherited methods

From class ` https://developer.android.com/reference/java/lang/Object ` ` https://developer.android.com/reference/java/lang/Object` ` https://developer.android.com/reference/java/lang/Object#clone()() `

Creates and returns a copy of this object.
` boolean` ` https://developer.android.com/reference/java/lang/Object#equals(java.lang.Object)(https://developer.android.com/reference/java/lang/Object obj) `

Indicates whether some other object is "equal to" this one.
` void` ` https://developer.android.com/reference/java/lang/Object#finalize()() `

Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.
` final https://developer.android.com/reference/java/lang/Class<?>` ` https://developer.android.com/reference/java/lang/Object#getClass()() `

Returns the runtime class of this `Object`.
` int` ` https://developer.android.com/reference/java/lang/Object#hashCode()() `

Returns a hash code value for the object.
` final void` ` https://developer.android.com/reference/java/lang/Object#notify()() `

Wakes up a single thread that is waiting on this object's monitor.
` final void` ` https://developer.android.com/reference/java/lang/Object#notifyAll()() `

Wakes up all threads that are waiting on this object's monitor.
` https://developer.android.com/reference/java/lang/String` ` https://developer.android.com/reference/java/lang/Object#toString()() `

Returns a string representation of the object.
` final void` ` https://developer.android.com/reference/java/lang/Object#wait(long,%20int)(long timeoutMillis, int nanos) `

Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*, or until a certain amount of real time has elapsed.
` final void` ` https://developer.android.com/reference/java/lang/Object#wait(long)(long timeoutMillis) `

Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*, or until a certain amount of real time has elapsed.
` final void` ` https://developer.android.com/reference/java/lang/Object#wait()() `

Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*.

## Constants

### READ_SCREEN_CONTEXT_REQUEST_STATE_GRANTED

Added in [API level 37](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int READ_SCREEN_CONTEXT_REQUEST_STATE_GRANTED
```

Read screen context access is granted.

<br />

**See also:**

- `https://developer.android.com/reference/android/app/voiceinteraction/VoiceInteractionManager#getReadScreenContextRequestState()`

Constant Value: 0 (0x00000000)

### READ_SCREEN_CONTEXT_REQUEST_STATE_REQUESTABLE

Added in [API level 37](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int READ_SCREEN_CONTEXT_REQUEST_STATE_REQUESTABLE
```

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.

<br />

**See also:**

- `https://developer.android.com/reference/android/app/voiceinteraction/VoiceInteractionManager#getReadScreenContextRequestState()`

Constant Value: 1 (0x00000001)

### READ_SCREEN_CONTEXT_REQUEST_STATE_UNREQUESTABLE

Added in [API level 37](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int READ_SCREEN_CONTEXT_REQUEST_STATE_UNREQUESTABLE
```

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.

<br />

**See also:**

- `https://developer.android.com/reference/android/app/voiceinteraction/VoiceInteractionManager#getReadScreenContextRequestState()`

Constant Value: 2 (0x00000002)

## Public methods

### canReadScreenContext

Added in [API level 37](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public boolean canReadScreenContext ()
```

Returns whether the calling app can read screen context.

<br />

| Returns ||
|---|---|
| `boolean` | `true` if the calling app is the current assistant and has access to screen context , `false` otherwise. <br /> |

### createRequestReadScreenContextIntent

Added in [API level 37](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public Intent createRequestReadScreenContextIntent ()
```

Creates an intent which can be used to request access to screen context for current assistant role holder. This intent MUST be used with `https://developer.android.com/reference/android/app/Activity#startActivityForResult(android.content.Intent,%20int)`. The result code of the activity will be `https://developer.android.com/reference/android/app/Activity#RESULT_OK` if the request was granted, `https://developer.android.com/reference/android/app/Activity#RESULT_CANCELED` if not. If the caller is not the current default assistant, the request will be denied automatically.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/content/Intent` | The created intent. This value cannot be `null`. <br /> |

### getReadScreenContextRequestState

Added in [API level 37](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public int getReadScreenContextRequestState ()
```

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).

<br />

| Returns ||
|---|---|
| `int` | The current request state of the specified access, represented by one of the following constants: `https://developer.android.com/reference/android/app/voiceinteraction/VoiceInteractionManager#READ_SCREEN_CONTEXT_REQUEST_STATE_GRANTED`, `https://developer.android.com/reference/android/app/voiceinteraction/VoiceInteractionManager#READ_SCREEN_CONTEXT_REQUEST_STATE_REQUESTABLE`, or `https://developer.android.com/reference/android/app/voiceinteraction/VoiceInteractionManager#READ_SCREEN_CONTEXT_REQUEST_STATE_UNREQUESTABLE` Value is one of the following: - `https://developer.android.com/reference/android/app/voiceinteraction/VoiceInteractionManager#READ_SCREEN_CONTEXT_REQUEST_STATE_GRANTED` - `https://developer.android.com/reference/android/app/voiceinteraction/VoiceInteractionManager#READ_SCREEN_CONTEXT_REQUEST_STATE_REQUESTABLE` - `https://developer.android.com/reference/android/app/voiceinteraction/VoiceInteractionManager#READ_SCREEN_CONTEXT_REQUEST_STATE_UNREQUESTABLE` |