Added in API level 29

VoiceInteractionSession.AssistState


public static final class VoiceInteractionSession.AssistState
extends Object

java.lang.Object
   ↳ android.service.voice.VoiceInteractionSession.AssistState


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

VoiceInteractionSession.ActivityId getActivityId()
AssistContent getAssistContent()
Bundle getAssistData()
AssistStructure getAssistStructure()
int getCount()
int getIndex()
boolean isFocused()

Inherited methods

Public methods

getActivityId

Added in API level 29
public VoiceInteractionSession.ActivityId getActivityId ()

Returns
VoiceInteractionSession.ActivityId the id of the source activity This value cannot be null.

getAssistContent

Added in API level 29
public AssistContent getAssistContent ()

Returns
AssistContent Additional content data supplied by the app through Activity.onProvideAssistContent. 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 VoiceInteractionSession.SHOW_WITH_ASSIST. Will not be automatically filled in with data from the app if the app has marked its window as secure.

getAssistData

Added in API level 29
public Bundle getAssistData ()

Returns
Bundle Arbitrary data supplied by the app through Activity.onProvideAssistData. 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 VoiceInteractionSession.SHOW_WITH_ASSIST.

getAssistStructure

Added in API level 29
public AssistStructure getAssistStructure ()

Returns
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 VoiceInteractionSession.SHOW_WITH_ASSIST or the assist data has been corrupt when writing the data to AssistStructure; will be an empty stub if the application has disabled assist by marking its window as secure.

getCount

Added in API level 29
public int getCount ()

Returns
int the total number of activities for which the assist data is being returned. Value is 0 or greater

getIndex

Added in API level 29
public int getIndex ()

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

isFocused

Added in API level 29
public boolean isFocused ()

Returns
boolean whether the source activity is focused.