ConversationAction


public final class ConversationAction
extends Object implements Parcelable

java.lang.Object
   ↳ android.view.textclassifier.ConversationAction


Represents the action suggested by a TextClassifier on a given conversation.

Summary

Nested classes

class ConversationAction.Builder

Builder class to construct ConversationAction

Constants

String TYPE_CALL_PHONE

Indicates an action to call a phone number.

String TYPE_CREATE_REMINDER

Indicates an action to create a reminder.

String TYPE_OPEN_URL

Indicates an action to open an URL.

String TYPE_SEND_EMAIL

Indicates an action to send an email.

String TYPE_SEND_SMS

Indicates an action to send a SMS.

String TYPE_SHARE_LOCATION

Indicates an action to reply with a location.

String TYPE_TEXT_REPLY

Indicates an action to reply with a text message.

String TYPE_TRACK_FLIGHT

Indicates an action to track a flight.

String TYPE_VIEW_CALENDAR

Indicates an action to view a calendar at a specified time.

String TYPE_VIEW_MAP

Indicates an action to view the map at a specified location.

Inherited constants

int CONTENTS_FILE_DESCRIPTOR

Descriptor bit used with describeContents(): indicates that the Parcelable object's flattened representation includes a file descriptor.

int PARCELABLE_WRITE_RETURN_VALUE

Flag for use with writeToParcel(Parcel, int): the object being written is a return value, that is the result of a function such as "Parcelable someFunction()", "void someFunction(out Parcelable)", or "void someFunction(inout Parcelable)".

Fields

public static final Creator<ConversationAction> CREATOR

Public methods

int describeContents()

Describe the kinds of special objects contained in this Parcelable instance's marshaled representation.

RemoteAction getAction()

Returns a RemoteAction object, which contains the icon, label and a PendingIntent, for the specified action type.

float getConfidenceScore()

Returns the confidence score for the specified action.

Bundle getExtras()

Returns the extended data related to this conversation action.

CharSequence getTextReply()

Returns the text reply that could be sent as a reply to the given conversation.

String getType()

Returns the type of this action, for example, TYPE_VIEW_CALENDAR.

void writeToParcel(Parcel parcel, int flags)

Flatten this object in to a Parcel.

Inherited methods

Object clone()

Creates and returns a copy of this object.

boolean equals(Object obj)

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

void finalize()

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

final Class<?> getClass()

Returns the runtime class of this Object.

int hashCode()

Returns a hash code value for the object.

final void notify()

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

final void notifyAll()

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

String toString()

Returns a string representation of the object.

final void wait(long timeoutMillis, int nanos)

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

final void wait(long timeoutMillis)

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

final void wait()

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

abstract int describeContents()

Describe the kinds of special objects contained in this Parcelable instance's marshaled representation.

abstract void writeToParcel(Parcel dest, int flags)

Flatten this object in to a Parcel.

Constants

TYPE_CALL_PHONE

Added in API level 29
public static final String TYPE_CALL_PHONE

Indicates an action to call a phone number.

Constant Value: "call_phone"

TYPE_CREATE_REMINDER

Added in API level 29
public static final String TYPE_CREATE_REMINDER

Indicates an action to create a reminder.

Constant Value: "create_reminder"

TYPE_OPEN_URL

Added in API level 29
public static final String TYPE_OPEN_URL

Indicates an action to open an URL.

Constant Value: "open_url"

TYPE_SEND_EMAIL

Added in API level 29
public static final String TYPE_SEND_EMAIL

Indicates an action to send an email.

Constant Value: "send_email"

TYPE_SEND_SMS

Added in API level 29
public static final String TYPE_SEND_SMS

Indicates an action to send a SMS.

Constant Value: "send_sms"

TYPE_SHARE_LOCATION

Added in API level 29
public static final String TYPE_SHARE_LOCATION

Indicates an action to reply with a location.

Constant Value: "share_location"

TYPE_TEXT_REPLY

Added in API level 29
public static final String TYPE_TEXT_REPLY

Indicates an action to reply with a text message.

Constant Value: "text_reply"

TYPE_TRACK_FLIGHT

Added in API level 29
public static final String TYPE_TRACK_FLIGHT

Indicates an action to track a flight.

Constant Value: "track_flight"

TYPE_VIEW_CALENDAR

Added in API level 29
public static final String TYPE_VIEW_CALENDAR

Indicates an action to view a calendar at a specified time.

Constant Value: "view_calendar"

TYPE_VIEW_MAP

Added in API level 29
public static final String TYPE_VIEW_MAP

Indicates an action to view the map at a specified location.

Constant Value: "view_map"

Fields

CREATOR

Added in API level 29
public static final Creator<ConversationAction> CREATOR

Public methods

describeContents

Added in API level 29
public int describeContents ()

Describe the kinds of special objects contained in this Parcelable instance's marshaled representation. For example, if the object will include a file descriptor in the output of writeToParcel(android.os.Parcel, int), the return value of this method must include the CONTENTS_FILE_DESCRIPTOR bit.

Returns
int a bitmask indicating the set of special object types marshaled by this Parcelable object instance. Value is either 0 or CONTENTS_FILE_DESCRIPTOR

getAction

Added in API level 29
public RemoteAction getAction ()

Returns a RemoteAction object, which contains the icon, label and a PendingIntent, for the specified action type.

Returns
RemoteAction This value may be null.

getConfidenceScore

Added in API level 29
public float getConfidenceScore ()

Returns the confidence score for the specified action. The value ranges from 0 (low confidence) to 1 (high confidence).

Returns
float Value is between 0 and 1 inclusive

getExtras

Added in API level 29
public Bundle getExtras ()

Returns the extended data related to this conversation action.

NOTE: Do not modify this bundle.

Returns
Bundle This value cannot be null.

getTextReply

Added in API level 29
public CharSequence getTextReply ()

Returns the text reply that could be sent as a reply to the given conversation.

This is only available when the type of the action is TYPE_TEXT_REPLY.

Returns
CharSequence This value may be null.

getType

Added in API level 29
public String getType ()

Returns the type of this action, for example, TYPE_VIEW_CALENDAR.

writeToParcel

Added in API level 29
public void writeToParcel (Parcel parcel, 
                int flags)

Flatten this object in to a Parcel.

Parameters
parcel Parcel: The Parcel in which the object should be written. This value cannot be null.

flags int: Additional flags about how the object should be written. May be 0 or Parcelable.PARCELABLE_WRITE_RETURN_VALUE. Value is either 0 or a combination of Parcelable.PARCELABLE_WRITE_RETURN_VALUE, and android.os.Parcelable.PARCELABLE_ELIDE_DUPLICATES