ConversationData.Builder


public static final class ConversationData.Builder
extends Object

java.lang.Object
   ↳ android.app.personalcontext.hint.ConversationData.Builder


Builder for ConversationData.

Summary

Public constructors

Builder()

Public methods

ConversationData build()

Builds the ConversationData.

ConversationData.Builder setChatMessages(List<ChatMessageData> chatMessages)

Sets the chat messages in the conversation.

ConversationData.Builder setComponentName(ComponentName componentName)

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

ConversationData.Builder setConversationTitle(String conversationTitle)

Sets the title of the conversation.

ConversationData.Builder setHasNewMessage(boolean hasNewMessage)

Sets whether there is a new message in view.

ConversationData.Builder setInputBoxAutofillId(AutofillId inputBoxAutofillId)

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

ConversationData.Builder setInputBoxText(String inputBoxText)

Sets the text in the input box.

ConversationData.Builder setKeyboardShown(boolean isKeyboardShown)

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

ConversationData.Builder setLastMessageFromTheUser(boolean isLastMessageFromTheUser)

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

ConversationData.Builder setProcessingEndTimestampMillis(long processingEndTimestampMillis)

Sets the timestamp when Content Capture finished processing the conversation.

ConversationData.Builder setProcessingStartTimestampMillis(long processingStartTimestampMillis)

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

Inherited methods

Public constructors

Builder

Added in version 37.2
public Builder ()

Public methods

build

Added in version 37.2
public ConversationData build ()

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

Returns
ConversationData This value cannot be null.

setChatMessages

Added in version 37.2
public ConversationData.Builder setChatMessages (List<ChatMessageData> chatMessages)

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 List: This value cannot be null.

Returns
ConversationData.Builder This value cannot be null.

setComponentName

Added in version 37.2
public ConversationData.Builder setComponentName (ComponentName componentName)

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.

Returns
ConversationData.Builder This value cannot be null.

setConversationTitle

Added in version 37.2
public ConversationData.Builder setConversationTitle (String conversationTitle)

Sets the title of the conversation.

This is a required builder input.

Parameters
conversationTitle String: This value cannot be null.

Returns
ConversationData.Builder This value cannot be null.

setHasNewMessage

Added in version 37.2
public ConversationData.Builder setHasNewMessage (boolean hasNewMessage)

Sets whether there is a new message in view.

This is a required builder input.

Parameters
hasNewMessage boolean

Returns
ConversationData.Builder This value cannot be null.

setInputBoxAutofillId

Added in version 37.2
public ConversationData.Builder setInputBoxAutofillId (AutofillId inputBoxAutofillId)

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.

Returns
ConversationData.Builder This value cannot be null.

setInputBoxText

Added in version 37.2
public ConversationData.Builder setInputBoxText (String inputBoxText)

Sets the text in the input box.

This is a required builder input.

Parameters
inputBoxText String: This value cannot be null.

Returns
ConversationData.Builder This value cannot be null.

setKeyboardShown

Added in version 37.2
public ConversationData.Builder setKeyboardShown (boolean isKeyboardShown)

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.

Parameters
isKeyboardShown boolean

Returns
ConversationData.Builder This value cannot be null.

setLastMessageFromTheUser

Added in version 37.2
public ConversationData.Builder setLastMessageFromTheUser (boolean isLastMessageFromTheUser)

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

This is a required builder input.

Parameters
isLastMessageFromTheUser boolean

Returns
ConversationData.Builder This value cannot be null.

setProcessingEndTimestampMillis

Added in version 37.2
public ConversationData.Builder setProcessingEndTimestampMillis (long processingEndTimestampMillis)

Sets the timestamp when Content Capture finished processing the conversation.

This is a required builder input.

Parameters
processingEndTimestampMillis long

Returns
ConversationData.Builder This value cannot be null.

setProcessingStartTimestampMillis

Added in version 37.2
public ConversationData.Builder setProcessingStartTimestampMillis (long processingStartTimestampMillis)

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

This is a required builder input.

Parameters
processingStartTimestampMillis long

Returns
ConversationData.Builder This value cannot be null.