Builder


class Builder
kotlin.Any
   ↳ android.app.personalcontext.hint.ConversationData.Builder

Builder for ConversationData.

Summary

Public constructors

Public methods
ConversationData

Builds the ConversationData.

ConversationData.Builder

Sets the chat messages in the conversation.

ConversationData.Builder

Sets the component name of the activity that contains the conversation.

ConversationData.Builder
setConversationTitle(conversationTitle: String)

Sets the title of the conversation.

ConversationData.Builder
setHasNewMessage(hasNewMessage: Boolean)

Sets whether there is a new message in view.

ConversationData.Builder
setInputBoxAutofillId(inputBoxAutofillId: AutofillId?)

Sets the autofill id of the input box in the conversation.

ConversationData.Builder
setInputBoxText(inputBoxText: String)

Sets the text in the input box.

ConversationData.Builder
setKeyboardShown(isKeyboardShown: Boolean)

Sets whether the keyboard was shown at the time the conversation was parsed.

ConversationData.Builder
setLastMessageFromTheUser(isLastMessageFromTheUser: Boolean)

Sets whether the last message in the conversation is from the user.

ConversationData.Builder
setProcessingEndTimestampMillis(processingEndTimestampMillis: Long)

Sets the timestamp when Content Capture finished processing the conversation.

ConversationData.Builder
setProcessingStartTimestampMillis(processingStartTimestampMillis: Long)

Sets the timestamp when Content Capture first saw the message and the processing of the conversation started.

Public constructors

Builder

Builder()

Public methods

build

fun build(): ConversationData

Builds the ConversationData. All setters are required other than #setActivityId(android.app.assist.ActivityId).

Return
ConversationData This value cannot be null.

setChatMessages

fun setChatMessages(chatMessages: MutableList<ChatMessageData!>): ConversationData.Builder

Sets the chat messages in the conversation.

The list should be sorted by order of earliest appearance in the conversation, matching what the user sees in the UI.

This is a required builder input.

Parameters
chatMessages MutableList<ChatMessageData!>: This value cannot be null.
Return
ConversationData.Builder This value cannot be null.

setComponentName

fun setComponentName(componentName: ComponentName): ConversationData.Builder

Sets the component name of the activity that contains the conversation.

This is a required builder input.

Parameters
componentName ComponentName: This value cannot be null.
Return
ConversationData.Builder This value cannot be null.

setConversationTitle

fun setConversationTitle(conversationTitle: String): ConversationData.Builder

Sets the title of the conversation.

This is a required builder input.

Parameters
conversationTitle String: This value cannot be null.
Return
ConversationData.Builder This value cannot be null.

setHasNewMessage

fun setHasNewMessage(hasNewMessage: Boolean): ConversationData.Builder

Sets whether there is a new message in view.

This is a required builder input.

Return
ConversationData.Builder This value cannot be null.

setInputBoxAutofillId

fun setInputBoxAutofillId(inputBoxAutofillId: AutofillId?): ConversationData.Builder

Sets the autofill id of the input box in the conversation.

This is a required builder input.

Parameters
inputBoxAutofillId AutofillId?: This value may be null.
Return
ConversationData.Builder This value cannot be null.

setInputBoxText

fun setInputBoxText(inputBoxText: String): ConversationData.Builder

Sets the text in the input box.

This is a required builder input.

Parameters
inputBoxText String: This value cannot be null.
Return
ConversationData.Builder This value cannot be null.

setKeyboardShown

fun setKeyboardShown(isKeyboardShown: Boolean): ConversationData.Builder

Sets whether the keyboard was shown at the time the conversation was parsed.

This can be used by the understander as a signal to decide what models to run. Since this state may have changed since the hint was created, renderers should still check if the keyboard is showing before showing results.

This is a required builder input.

Return
ConversationData.Builder This value cannot be null.

setLastMessageFromTheUser

fun setLastMessageFromTheUser(isLastMessageFromTheUser: Boolean): ConversationData.Builder

Sets whether the last message in the conversation is from the user.

This is a required builder input.

Return
ConversationData.Builder This value cannot be null.

setProcessingEndTimestampMillis

fun setProcessingEndTimestampMillis(processingEndTimestampMillis: Long): ConversationData.Builder

Sets the timestamp when Content Capture finished processing the conversation.

This is a required builder input.

Return
ConversationData.Builder This value cannot be null.

setProcessingStartTimestampMillis

fun setProcessingStartTimestampMillis(processingStartTimestampMillis: Long): ConversationData.Builder

Sets the timestamp when Content Capture first saw the message and the processing of the conversation started.

This is a required builder input.

Return
ConversationData.Builder This value cannot be null.