Added in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels) Summary: [Methods](https://developer.android.com/reference/android/service/voice/VoiceInteractionSession.AssistState#pubmethods) \| [Inherited Methods](https://developer.android.com/reference/android/service/voice/VoiceInteractionSession.AssistState#inhmethods)

# VoiceInteractionSession.AssistState

*** ** * ** ***

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

|---|---|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object) ||
| ↳ | android.service.voice.VoiceInteractionSession.AssistState |

<br />

*** ** * ** ***

Represents assist state captured when this session was started. It contains the various assist data objects and a reference to the source activity.

## Summary

| ### Public methods ||
|---|---|
| ` https://developer.android.com/reference/android/service/voice/VoiceInteractionSession.ActivityId` | ` https://developer.android.com/reference/android/service/voice/VoiceInteractionSession.AssistState#getActivityId()() ` |
| ` https://developer.android.com/reference/android/app/assist/AssistContent` | ` https://developer.android.com/reference/android/service/voice/VoiceInteractionSession.AssistState#getAssistContent()() ` |
| ` https://developer.android.com/reference/android/os/Bundle` | ` https://developer.android.com/reference/android/service/voice/VoiceInteractionSession.AssistState#getAssistData()() ` |
| ` https://developer.android.com/reference/android/app/assist/AssistStructure` | ` https://developer.android.com/reference/android/service/voice/VoiceInteractionSession.AssistState#getAssistStructure()() ` |
| ` int` | ` https://developer.android.com/reference/android/service/voice/VoiceInteractionSession.AssistState#getCount()() ` |
| ` int` | ` https://developer.android.com/reference/android/service/voice/VoiceInteractionSession.AssistState#getIndex()() ` |
| ` boolean` | ` https://developer.android.com/reference/android/service/voice/VoiceInteractionSession.AssistState#isFocused()() ` |

### 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*.

## Public methods

### getActivityId

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

```
public VoiceInteractionSession.ActivityId getActivityId ()
```

<br />

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/service/voice/VoiceInteractionSession.ActivityId` | the id of the source activity. This value cannot be `null`. <br /> |

### getAssistContent

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

```
public AssistContent getAssistContent ()
```

<br />

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/app/assist/AssistContent` | Additional content data supplied by the app through `https://developer.android.com/reference/android/app/Activity#onProvideAssistContent(android.app.assist.AssistContent)`. May be null if assist data has been disabled by the user or device policy; will be null if the original show request did not specify `https://developer.android.com/reference/android/service/voice/VoiceInteractionSession#SHOW_WITH_ASSIST`. Will not be automatically filled in with data from the app if the app has marked its window as secure. <br /> |

### getAssistData

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

```
public Bundle getAssistData ()
```

<br />

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/os/Bundle` | Arbitrary data supplied by the app through `https://developer.android.com/reference/android/app/Activity#onProvideAssistData(android.os.Bundle)`. May be null if assist data has been disabled by the user or device policy; will be null if the original show request did not specify `https://developer.android.com/reference/android/service/voice/VoiceInteractionSession#SHOW_WITH_ASSIST`. <br /> |

### getAssistStructure

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

```
public AssistStructure getAssistStructure ()
```

<br />

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/app/assist/AssistStructure` | If available, the structure definition of all windows currently displayed by the app. May be null if assist data has been disabled by the user or device policy; will be null if the original show request did not specify `https://developer.android.com/reference/android/service/voice/VoiceInteractionSession#SHOW_WITH_ASSIST` or the assist data has been corrupt when writing the data to `https://developer.android.com/reference/android/app/assist/AssistStructure`; will be an empty stub if the application has disabled assist by marking its window as secure. <br /> |

### getCount

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

```
public int getCount ()
```

<br />

<br />

| Returns ||
|---|---|
| `int` | the total number of activities for which the assist data is being returned. Value is 0 or greater <br /> |

### getIndex

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

```
public int getIndex ()
```

<br />

<br />

| Returns ||
|---|---|
| `int` | the index of the activity that this state is for or -1 if there was no assist data captured. Value is -1 or greater <br /> |

### isFocused

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

```
public boolean isFocused ()
```

<br />

<br />

| Returns ||
|---|---|
| `boolean` | whether the source activity is focused. <br /> |