VoiceInteractionSession Class

Definition

An active voice interaction session, providing a facility for the implementation to interact with the user in the voice interaction layer.

[Android.Runtime.Register("android/service/voice/VoiceInteractionSession", DoNotGenerateAcw=true)]
public class VoiceInteractionSession : Java.Lang.Object, Android.Content.IComponentCallbacks2, Android.Views.KeyEvent.ICallback, IDisposable, Java.Interop.IJavaPeerable
[<Android.Runtime.Register("android/service/voice/VoiceInteractionSession", DoNotGenerateAcw=true)>]
type VoiceInteractionSession = class
    inherit Object
    interface IComponentCallbacks2
    interface IComponentCallbacks
    interface IJavaObject
    interface IDisposable
    interface IJavaPeerable
    interface KeyEvent.ICallback
Inheritance
VoiceInteractionSession
Attributes
Implements

Remarks

An active voice interaction session, providing a facility for the implementation to interact with the user in the voice interaction layer. The user interface is initially shown by default, and can be created by overriding #onCreateContentView() in which the UI can be built.

A voice interaction session can be self-contained, ultimately calling #finish when done. It can also initiate voice interactions with applications by calling #startVoiceActivity

.

Java documentation for android.service.voice.VoiceInteractionSession.

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Constructors

VoiceInteractionSession(Context)
VoiceInteractionSession(Context, Handler)
VoiceInteractionSession(IntPtr, JniHandleOwnership)

A constructor used when creating managed representations of JNI objects; called by the runtime.

Fields

KeyShowSessionId

Bundle key used to specify the id when the system prepares to show session.

Properties

Class

Returns the runtime class of this Object.

(Inherited from Object)
Context
DisabledShowContext

Equivalent to VoiceInteractionService#getDisabledShowContext VoiceInteractionService.getDisabledShowContext. -or- Equivalent to VoiceInteractionService#setDisabledShowContext VoiceInteractionService.setDisabledShowContext(int).

Handle

The handle to the underlying Android instance.

(Inherited from Object)
JniIdentityHashCode (Inherited from Object)
JniPeerMembers
LayoutInflater

Convenience for inflating views.

PeerReference (Inherited from Object)
ThresholdClass

This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.

ThresholdType

This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.

UserDisabledShowContext

Return which show context flags have been disabled by the user through the system settings UI, so the session will never get this data.

Window

Retrieve the window being used to show the session's UI.

Methods

Clone()

Creates and returns a copy of this object.

(Inherited from Object)
CloseSystemDialogs()

Request that all system dialogs (and status bar shade etc) be closed, allowing access to the session's UI.

Dispose() (Inherited from Object)
Dispose(Boolean) (Inherited from Object)
Dump(String, FileDescriptor, PrintWriter, String[])

Print the Service's state into the given stream.

Equals(Object)

Indicates whether some other object is "equal to" this one.

(Inherited from Object)
Finish()

Finish the session.

GetHashCode()

Returns a hash code value for the object.

(Inherited from Object)
Hide()

Hide the session's UI, if currently shown.

JavaFinalize()

Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.

(Inherited from Object)
Notify()

Wakes up a single thread that is waiting on this object's monitor.

(Inherited from Object)
NotifyAll()

Wakes up all threads that are waiting on this object's monitor.

(Inherited from Object)
OnAssistStructureFailure(Throwable)

Called when there has been a failure transferring the AssistStructure to the assistant.

OnBackPressed()

Called when the user presses the back button while focus is in the session UI.

OnCancelRequest(VoiceInteractionSession+Request)

Called when the android.app.VoiceInteractor has asked to cancel a Request that was previously delivered to #onRequestConfirmation, #onRequestPickOption, #onRequestCompleteVoice, #onRequestAbortVoice, or #onRequestCommand.

OnCloseSystemDialogs()

Sessions automatically watch for requests that all system UI be closed (such as when the user presses HOME), which will appear here.

OnComputeInsets(VoiceInteractionSession+Insets)

Compute the interesting insets into your UI.

OnConfigurationChanged(Configuration)
OnCreate()

Initiatize a new session.

OnCreate(Bundle)

Initiatize a new session.

OnCreateContentView()

Hook in which to create the session's UI.

OnDestroy()

Last callback to the session as it is being finished.

OnDirectActionsInvalidated(VoiceInteractionSession+ActivityId)

Called when the direct actions are invalidated.

OnGetSupportedCommands(String[])

Request to query for what extended commands the session supports.

OnHandleAssist(Bundle, AssistStructure, AssistContent)

Called to receive data from the application that the user was currently viewing when - * an assist session is started.

OnHandleAssist(VoiceInteractionSession+AssistState)

Called to receive data from the application that the user was currently viewing when - * an assist session is started.

OnHandleAssistSecondary(Bundle, AssistStructure, AssistContent, Int32, Int32)

Called to receive data from other applications that the user was or is interacting with, that are currently on the screen in a multi-window display environment, not including the currently focused activity.

OnHandleScreenshot(Bitmap)

Called to receive a screenshot of what the user was currently viewing when an assist session is started.

OnHide()

Called immediately after stopping to show the session UI.

OnKeyDown(Keycode, KeyEvent)

Called when a key down event has occurred.

OnKeyLongPress(Keycode, KeyEvent)

Called when a long press has occurred.

OnKeyMultiple(Keycode, Int32, KeyEvent)

Called when multiple down/up pairs of the same key have occurred in a row.

OnKeyUp(Keycode, KeyEvent)

Called when a key up event has occurred.

OnLockscreenShown()

Called when the lockscreen was shown.

OnLowMemory()
OnPrepareShow(Bundle, ShowFlags)

Called prior to #onShow before any UI setup has occurred.

OnRequestAbortVoice(VoiceInteractionSession+AbortVoiceRequest)

Request to abort the voice interaction session because the voice activity can not complete its interaction using voice.

OnRequestCommand(VoiceInteractionSession+CommandRequest)

Process an arbitrary extended command from the caller, corresponding to a android.app.VoiceInteractor.CommandRequest VoiceInteractor.CommandRequest.

OnRequestCompleteVoice(VoiceInteractionSession+CompleteVoiceRequest)

Request to complete the voice interaction session because the voice activity successfully completed its interaction using voice.

OnRequestConfirmation(VoiceInteractionSession+ConfirmationRequest)

Request to confirm with the user before proceeding with an unrecoverable operation, corresponding to a android.app.VoiceInteractor.ConfirmationRequest VoiceInteractor.ConfirmationRequest.

OnRequestPickOption(VoiceInteractionSession+PickOptionRequest)

Request for the user to pick one of N options, corresponding to a android.app.VoiceInteractor.PickOptionRequest VoiceInteractor.PickOptionRequest.

OnShow(Bundle, ShowFlags)

Called when the session UI is going to be shown.

OnTaskFinished(Intent, Int32)

Called when the last activity of a task initiated by #startVoiceActivity(android.content.Intent) has finished.

OnTaskStarted(Intent, Int32)

Called when a task initiated by #startVoiceActivity(android.content.Intent) has actually started.

OnTrimMemory(TrimMemory)
PerformDirectAction(DirectAction, Bundle, CancellationSignal, IExecutor, IConsumer)

Asks that an action be performed by the app.

RegisterVisibleActivityCallback(IExecutor, VoiceInteractionSession+IVisibleActivityCallback)
RequestDirectActions(VoiceInteractionSession+ActivityId, CancellationSignal, IExecutor, IConsumer)

Requests a list of supported actions from an app.

SetContentView(View)
SetHandle(IntPtr, JniHandleOwnership)

Sets the Handle property.

(Inherited from Object)
SetKeepAwake(Boolean)

Set whether this session will keep the device awake while it is running a voice activity.

SetTheme(Int32)

You can call this to customize the theme used by your IME's window.

SetUiEnabled(Boolean)

Control whether the UI layer for this session is enabled.

Show(Bundle, ShowFlags)

Show the UI for this session.

StartAssistantActivity(Intent)

Ask that a new assistant activity be started.

StartAssistantActivity(Intent, Bundle)

Ask that a new assistant activity be started.

StartVoiceActivity(Intent)

Ask that a new activity be started for voice interaction.

ToArray<T>() (Inherited from Object)
ToString()

Returns a string representation of the object.

(Inherited from Object)
UnregisterFromRuntime() (Inherited from Object)
UnregisterVisibleActivityCallback(VoiceInteractionSession+IVisibleActivityCallback)
Wait()

Causes the current thread to wait until it is awakened, typically by being <em>notified</em> or <em>interrupted</em>.

(Inherited from Object)
Wait(Int64)

Causes the current thread to wait until it is awakened, typically by being <em>notified</em> or <em>interrupted</em>, or until a certain amount of real time has elapsed.

(Inherited from Object)
Wait(Int64, Int32)

Causes the current thread to wait until it is awakened, typically by being <em>notified</em> or <em>interrupted</em>, or until a certain amount of real time has elapsed.

(Inherited from Object)

Explicit Interface Implementations

IJavaPeerable.Disposed() (Inherited from Object)
IJavaPeerable.DisposeUnlessReferenced() (Inherited from Object)
IJavaPeerable.Finalized() (Inherited from Object)
IJavaPeerable.JniManagedPeerState (Inherited from Object)
IJavaPeerable.SetJniIdentityHashCode(Int32) (Inherited from Object)
IJavaPeerable.SetJniManagedPeerState(JniManagedPeerStates) (Inherited from Object)
IJavaPeerable.SetPeerReference(JniObjectReference) (Inherited from Object)

Extension Methods

JavaCast<TResult>(IJavaObject)

Performs an Android runtime-checked type conversion.

JavaCast<TResult>(IJavaObject)
GetJniTypeName(IJavaPeerable)

Applies to