Skip to content
Commit 37ccedcc authored by Abodunrinwa Toki's avatar Abodunrinwa Toki Committed by Tony Mak
Browse files

Introduce TextClassifierEvent

This serves as a general TextClassifier event object for reporting
any textclassifier event and will replace the SelectionEvent class.

Example:

// Smart link clicked.
new TextClassifierEvent.Builder(CATEGORY_LINKIFY, TYPE_LINK_CLICKED)
  .setEventContext(new TextClassificationContext.Builder(
      pkgname, WIDGET_TYPE_TEXTVIEW)
      .build())
  .setEntityType(TextClassifier.EMAIL)
  .setResultId(textclassification.getId())
  .setEventIndex(0)
  .setEventTime(now)
  .setStart(0)
  .setEnd(3)
  .build();

Bug: 120837847
Test: See related cts CL
Test: atest cts/tests/tests/view/src/android/view/textclassifier/cts \
      frameworks/base/core/tests/coretests/src/android/view/textclassifier
Change-Id: Ifd84a45fc5c46ffdb200dcb9600f6a470ce792bb
parent c4359bf1
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment