summaryrefslogtreecommitdiff
path: root/tools/aapt2/java/JavaClassGenerator_test.cpp
diff options
context:
space:
mode:
authorTony Mak <tonymak@google.com>2020-11-17 17:23:00 +0000
committerTony Mak <tonymak@google.com>2020-12-02 21:28:04 +0000
commit2e853aa13965b8b79d3bc76b326223bc24585c73 (patch)
treedbf56431f723e0224bb5594b3f276b164ac2dfb6 /tools/aapt2/java/JavaClassGenerator_test.cpp
parent68a3422b492234ca3a89c6606685d3641fd849d9 (diff)
Introduce TextSelection.Builder.setIncludeTextClassification and TextSelection.getTextClassification()
This small API change enables us to optimize the latnecy of smart selection. To enable smart selection, TextView/WebView always call textClassifier.suggestSelection and textClassifier.classifyText back to back. There are a lot of overlaps between suggestSelection and classifyText, e.g. both API calls classify the entity type of the text. This optimization is important to make smart selection working responsively, especially that we enforce a 200ms timeout in TextView. This small API change allows the TextClassifier to implement smart selection with just one single API call. This change is backward-compatible. If the text classifier is not updated to return the text classification result in suggestSelection yet, clients can learn that by checking if textSelection.getTextClassification() returns null. If so, the client can then fallback to call ClassifyText(). You may find the textview integration in ag/13092679 Design doc: go/android-s-suggestselection Bug: 173512834 Test: atest TextSelectionTest Change-Id: If4cc827aa19d6d14c885cf10cd5ba16aa3041cf6
Diffstat (limited to 'tools/aapt2/java/JavaClassGenerator_test.cpp')
0 files changed, 0 insertions, 0 deletions