Added in API level 29

AssistState


class AssistState
kotlin.Any
   ↳ 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

AssistContent?

Bundle?

AssistStructure?

Int

Int

Boolean

Public methods

getActivityId

Added in API level 29
fun getActivityId(): VoiceInteractionSession.ActivityId
Return
VoiceInteractionSession.ActivityId the id of the source activity This value cannot be null.

getAssistContent

Added in API level 29
fun getAssistContent(): AssistContent?
Return
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 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
fun getAssistData(): Bundle?
Return
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 SHOW_WITH_ASSIST.

getAssistStructure

Added in API level 29
fun getAssistStructure(): AssistStructure?
Return
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 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
fun getCount(): Int
Return
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
fun getIndex(): Int
Return
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
fun isFocused(): Boolean
Return
Boolean whether the source activity is focused.