Added in API level 29

TextClassifierEvent


abstract class TextClassifierEvent : Parcelable
kotlin.Any
   ↳ android.view.textclassifier.TextClassifierEvent

This class represents events that are sent by components to the TextClassifier to report something of note that relates to a feature powered by the TextClassifier. The TextClassifier may log these events or use them to improve future responses to queries.

Each category of events has its their own subclass. Events of each type have an associated set of related properties. You can find their specification in the subclasses.

Summary

Nested classes
abstract

Builder to build a text classifier event.

This class represents events that are related to the conversation actions feature.

This class represents events that are related to the language detection feature.

This class represents events that are related to the smart linkify feature.

This class represents events that are related to the smart text selection feature.

Constants
static Int

Conversation actions

static Int

Language detection

static Int

Linkify

static Int

Smart selection

static Int

TextClassifier generated some actions

static Int

Smart actions shown to the user.

static Int

Something else other than user or the default TextClassifier triggered a selection.

static Int

User clicked on Copy action.

static Int

User clicked on Cut action.

static Int

Some text links were generated.

static Int

User clicked a link.

static Int

User composed a reply.

static Int

User clicked on a custom action.

static Int

User typed over the selection.

static Int

User clicked on Paste action.

static Int

Selection is destroyed.

static Int

User dragged+dropped the selection.

static Int

User modified an existing selection.

static Int

User reset the smart selection.

static Int

User started a new selection.

static Int

User clicked on Select All action

static Int

User clicked on Share action.

static Int

User clicked on a Smart action.

static Int

Smart selection triggered spanning multiple tokens (words).

static Int

Smart selection triggered for a single token (word).

Inherited constants
Public methods
open Int

open IntArray

Returns the indices of the actions relating to this event.

open Array<String!>

Returns an array of entity types.

open Int

Returns the event category.

open TextClassificationContext?

Returns the event context.

open Int

Returns the index of this event in the series of event it belongs to.

open Int

Returns the event type.

open Bundle

Returns a bundle containing non-structured extra information about this event.

open ULocale?

Returns the detected locale.

open String?

Returns the model name.

open String?

Returns the id of the text classifier result related to this event.

open FloatArray

Returns the scores of the suggestions.

open String

open Unit
writeToParcel(dest: Parcel, flags: Int)

Properties
static Parcelable.Creator<TextClassifierEvent!>

Constants

CATEGORY_CONVERSATION_ACTIONS

Added in API level 29
static val CATEGORY_CONVERSATION_ACTIONS: Int

Conversation actions

Value: 3

CATEGORY_LANGUAGE_DETECTION

Added in API level 29
static val CATEGORY_LANGUAGE_DETECTION: Int

Language detection

Value: 4

CATEGORY_LINKIFY

Added in API level 29
static val CATEGORY_LINKIFY: Int

Linkify

Value: 2

CATEGORY_SELECTION

Added in API level 29
static val CATEGORY_SELECTION: Int

Smart selection

Value: 1

TYPE_ACTIONS_GENERATED

Added in API level 29
static val TYPE_ACTIONS_GENERATED: Int

TextClassifier generated some actions

Value: 20

TYPE_ACTIONS_SHOWN

Added in API level 29
static val TYPE_ACTIONS_SHOWN: Int

Smart actions shown to the user.

Value: 6

TYPE_AUTO_SELECTION

Added in API level 29
static val TYPE_AUTO_SELECTION: Int

Something else other than user or the default TextClassifier triggered a selection.

Value: 5

TYPE_COPY_ACTION

Added in API level 29
static val TYPE_COPY_ACTION: Int

User clicked on Copy action.

Value: 9

TYPE_CUT_ACTION

Added in API level 29
static val TYPE_CUT_ACTION: Int

User clicked on Cut action.

Value: 11
Added in API level 30
static val TYPE_LINKS_GENERATED: Int

Some text links were generated.

Value: 21
Added in API level 29
static val TYPE_LINK_CLICKED: Int

User clicked a link.

Value: 7

TYPE_MANUAL_REPLY

Added in API level 29
static val TYPE_MANUAL_REPLY: Int

User composed a reply.

Value: 19

TYPE_OTHER_ACTION

Added in API level 29
static val TYPE_OTHER_ACTION: Int

User clicked on a custom action.

Value: 16

TYPE_OVERTYPE

Added in API level 29
static val TYPE_OVERTYPE: Int

User typed over the selection.

Value: 8

TYPE_PASTE_ACTION

Added in API level 29
static val TYPE_PASTE_ACTION: Int

User clicked on Paste action.

Value: 10

TYPE_SELECTION_DESTROYED

Added in API level 29
static val TYPE_SELECTION_DESTROYED: Int

Selection is destroyed.

Value: 15

TYPE_SELECTION_DRAG

Added in API level 29
static val TYPE_SELECTION_DRAG: Int

User dragged+dropped the selection.

Value: 14

TYPE_SELECTION_MODIFIED

Added in API level 29
static val TYPE_SELECTION_MODIFIED: Int

User modified an existing selection.

Value: 2

TYPE_SELECTION_RESET

Added in API level 29
static val TYPE_SELECTION_RESET: Int

User reset the smart selection.

Value: 18

TYPE_SELECTION_STARTED

Added in API level 29
static val TYPE_SELECTION_STARTED: Int

User started a new selection.

Value: 1

TYPE_SELECT_ALL

Added in API level 29
static val TYPE_SELECT_ALL: Int

User clicked on Select All action

Value: 17

TYPE_SHARE_ACTION

Added in API level 29
static val TYPE_SHARE_ACTION: Int

User clicked on Share action.

Value: 12

TYPE_SMART_ACTION

Added in API level 29
static val TYPE_SMART_ACTION: Int

User clicked on a Smart action.

Value: 13

TYPE_SMART_SELECTION_MULTI

Added in API level 29
static val TYPE_SMART_SELECTION_MULTI: Int

Smart selection triggered spanning multiple tokens (words).

Value: 4

TYPE_SMART_SELECTION_SINGLE

Added in API level 29
static val TYPE_SMART_SELECTION_SINGLE: Int

Smart selection triggered for a single token (word).

Value: 3

Public methods

describeContents

Added in API level 29
open fun describeContents(): Int
Return
Int a bitmask indicating the set of special object types marshaled by this Parcelable object instance. Value is either 0 or android.os.Parcelable#CONTENTS_FILE_DESCRIPTOR

getActionIndices

Added in API level 29
open fun getActionIndices(): IntArray

Returns the indices of the actions relating to this event. Actions are usually returned by the text classifier in priority order with the most preferred action at index 0. This list gives an indication of the position of the actions that are being reported.

Return
IntArray This value cannot be null.

getEntityTypes

Added in API level 29
open fun getEntityTypes(): Array<String!>

Returns an array of entity types. e.g. TextClassifier.TYPE_ADDRESS.

Return
Array<String!> This value cannot be null.

getEventContext

Added in API level 29
open fun getEventContext(): TextClassificationContext?

Returns the event context.

Return
TextClassificationContext? This value may be null.

getEventIndex

Added in API level 29
open fun getEventIndex(): Int

Returns the index of this event in the series of event it belongs to.

getEventType

Added in API level 29
open fun getEventType(): Int

Returns the event type. e.g. TYPE_SELECTION_STARTED.

Return
Int Value is android.view.textclassifier.TextClassifierEvent#TYPE_SELECTION_STARTED, android.view.textclassifier.TextClassifierEvent#TYPE_SELECTION_MODIFIED, android.view.textclassifier.TextClassifierEvent#TYPE_SMART_SELECTION_SINGLE, android.view.textclassifier.TextClassifierEvent#TYPE_SMART_SELECTION_MULTI, android.view.textclassifier.TextClassifierEvent#TYPE_AUTO_SELECTION, android.view.textclassifier.TextClassifierEvent#TYPE_ACTIONS_SHOWN, android.view.textclassifier.TextClassifierEvent#TYPE_LINK_CLICKED, android.view.textclassifier.TextClassifierEvent#TYPE_OVERTYPE, android.view.textclassifier.TextClassifierEvent#TYPE_COPY_ACTION, android.view.textclassifier.TextClassifierEvent#TYPE_PASTE_ACTION, android.view.textclassifier.TextClassifierEvent#TYPE_CUT_ACTION, android.view.textclassifier.TextClassifierEvent#TYPE_SHARE_ACTION, android.view.textclassifier.TextClassifierEvent#TYPE_SMART_ACTION, android.view.textclassifier.TextClassifierEvent#TYPE_SELECTION_DRAG, android.view.textclassifier.TextClassifierEvent#TYPE_SELECTION_DESTROYED, android.view.textclassifier.TextClassifierEvent#TYPE_OTHER_ACTION, android.view.textclassifier.TextClassifierEvent#TYPE_SELECT_ALL, android.view.textclassifier.TextClassifierEvent#TYPE_SELECTION_RESET, android.view.textclassifier.TextClassifierEvent#TYPE_MANUAL_REPLY, android.view.textclassifier.TextClassifierEvent#TYPE_ACTIONS_GENERATED, android.view.textclassifier.TextClassifierEvent#TYPE_LINKS_GENERATED, or android.view.textclassifier.TextClassifierEvent.TYPE_READ_CLIPBOARD

getExtras

Added in API level 29
open fun getExtras(): Bundle

Returns a bundle containing non-structured extra information about this event.

NOTE: Do not modify this bundle.

Return
Bundle This value cannot be null.

getLocale

Added in API level 29
open fun getLocale(): ULocale?

Returns the detected locale.

Return
ULocale? This value may be null.

getModelName

Added in API level 29
open fun getModelName(): String?

Returns the model name.

Return
String? This value may be null.

getResultId

Added in API level 29
open fun getResultId(): String?

Returns the id of the text classifier result related to this event.

Return
String? This value may be null.

getScores

Added in API level 29
open fun getScores(): FloatArray

Returns the scores of the suggestions.

Return
FloatArray This value cannot be null.

toString

Added in API level 29
open fun toString(): String
Return
String a string representation of the object.

writeToParcel

Added in API level 29
open fun writeToParcel(
    dest: Parcel,
    flags: Int
): Unit
Parameters
dest 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_WRITE_RETURN_VALUE. Value is either 0 or a combination of android.os.Parcelable#PARCELABLE_WRITE_RETURN_VALUE, and android.os.Parcelable.PARCELABLE_ELIDE_DUPLICATES

Properties

CREATOR

Added in API level 29
static val CREATOR: Parcelable.Creator<TextClassifierEvent!>