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

# VoiceInteractionSession.Request

*** ** * ** ***


`
public
static


class
VoiceInteractionSession.Request
`


`

extends https://developer.android.com/reference/java/lang/Object


`

`


`

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

|---|
| Known direct subclasses [VoiceInteractionSession.AbortVoiceRequest](https://developer.android.com/reference/android/service/voice/VoiceInteractionSession.AbortVoiceRequest), [VoiceInteractionSession.CommandRequest](https://developer.android.com/reference/android/service/voice/VoiceInteractionSession.CommandRequest), [VoiceInteractionSession.CompleteVoiceRequest](https://developer.android.com/reference/android/service/voice/VoiceInteractionSession.CompleteVoiceRequest), [VoiceInteractionSession.ConfirmationRequest](https://developer.android.com/reference/android/service/voice/VoiceInteractionSession.ConfirmationRequest), [VoiceInteractionSession.PickOptionRequest](https://developer.android.com/reference/android/service/voice/VoiceInteractionSession.PickOptionRequest) |---|---| | [VoiceInteractionSession.AbortVoiceRequest](https://developer.android.com/reference/android/service/voice/VoiceInteractionSession.AbortVoiceRequest) | A request to report that the current user interaction can not be completed with voice, as per `https://developer.android.com/reference/android/app/VoiceInteractor.AbortVoiceRequest`. | | [VoiceInteractionSession.CommandRequest](https://developer.android.com/reference/android/service/voice/VoiceInteractionSession.CommandRequest) | A generic vendor-specific request, as per `https://developer.android.com/reference/android/app/VoiceInteractor.CommandRequest`. | | [VoiceInteractionSession.CompleteVoiceRequest](https://developer.android.com/reference/android/service/voice/VoiceInteractionSession.CompleteVoiceRequest) | A request to simply inform the user that the voice operation has completed, as per `https://developer.android.com/reference/android/app/VoiceInteractor.CompleteVoiceRequest`. | | [VoiceInteractionSession.ConfirmationRequest](https://developer.android.com/reference/android/service/voice/VoiceInteractionSession.ConfirmationRequest) | A request for confirmation from the user of an operation, as per `https://developer.android.com/reference/android/app/VoiceInteractor.ConfirmationRequest`. | | [VoiceInteractionSession.PickOptionRequest](https://developer.android.com/reference/android/service/voice/VoiceInteractionSession.PickOptionRequest) | A request for the user to pick from a set of option, as per `https://developer.android.com/reference/android/app/VoiceInteractor.PickOptionRequest`. | |

<br />

*** ** * ** ***

Base class representing a request from a voice-driver app to perform a particular
voice operation with the user. See related subclasses for the types of requests
that are possible.

## Summary

| ### Public methods ||
|---|---|
| ` void` | ` https://developer.android.com/reference/android/service/voice/VoiceInteractionSession.Request#cancel()() ` Ask the app to cancel this current request. |
| ` https://developer.android.com/reference/java/lang/String` | ` https://developer.android.com/reference/android/service/voice/VoiceInteractionSession.Request#getCallingPackage()() ` Return the package name of the application that initiated the request. |
| ` int` | ` https://developer.android.com/reference/android/service/voice/VoiceInteractionSession.Request#getCallingUid()() ` Return the uid of the application that initiated the request. |
| ` https://developer.android.com/reference/android/os/Bundle` | ` https://developer.android.com/reference/android/service/voice/VoiceInteractionSession.Request#getExtras()() ` Return any additional extra information that was supplied as part of the request. |
| ` boolean` | ` https://developer.android.com/reference/android/service/voice/VoiceInteractionSession.Request#isActive()() ` Check whether this request is currently active. |
| ` https://developer.android.com/reference/java/lang/String` | ` https://developer.android.com/reference/android/service/voice/VoiceInteractionSession.Request#toString()() ` Returns a string representation of the object. |

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

### cancel

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

```
public void cancel ()
```

Ask the app to cancel this current request.
This also finishes the request (it is no longer active).

<br />

### getCallingPackage

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

```
public String getCallingPackage ()
```

Return the package name of the application that initiated the request.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/lang/String` | <br /> |

### getCallingUid

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

```
public int getCallingUid ()
```

Return the uid of the application that initiated the request.

<br />

| Returns ||
|---|---|
| `int` | <br /> |

### getExtras

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

```
public Bundle getExtras ()
```

Return any additional extra information that was supplied as part of the request.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/os/Bundle` | <br /> |

### isActive

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

```
public boolean isActive ()
```

Check whether this request is currently active. A request becomes inactive after
calling `https://developer.android.com/reference/android/service/voice/VoiceInteractionSession.Request#cancel()` or a final result method that completes the request. After
this point, further interactions with the request will result in
`https://developer.android.com/reference/java/lang/IllegalStateException` errors; you should not catch these errors,
but can use this method if you need to determine the state of the request. Returns
true if the request is still active.

<br />

| Returns ||
|---|---|
| `boolean` | <br /> |

### toString

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

```
public String toString ()
```

Returns a string representation of the object.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/lang/String` | a string representation of the object. <br /> |