summaryrefslogtreecommitdiff
path: root/tools/aapt2/java/JavaClassGenerator.cpp
diff options
context:
space:
mode:
authorJoanne Chung <joannechung@google.com>2020-07-06 17:21:57 +0800
committerJoanne Chung <joannechung@google.com>2020-07-06 17:41:55 +0800
commit6dfbe8316cb8b2fcd80db912812ca7d76a7359f9 (patch)
tree1bb21e958f4ae0673fd0f2a20b21b3ac92ae14a3 /tools/aapt2/java/JavaClassGenerator.cpp
parent1835a248390429fd7d573f219ed8f30bb5f5b87e (diff)
Fix app crash if the selection is from reverse direction.
When user types some text and then long presses on end of empty area to open context menu, if user opens Gboard and selects text from the reverse direction, SelectionEnd will be less than SelectionStart. The IllegalArgumentException occurred because TextClassification does not allow SelectionEnd is less than SelectionStart. We swap the start and end index if end index is less than start index. Bug: 150916165 Bug: 157452302 Test: Manual. No crash occurs. Test: atest FrameworksCoreTests:android.widget.TextViewActivityTest (cherry picked from commit cb3c97db0cf21df076735d71c573a754fa4ef072) Merged-In: I8dbc92f0f31e64b7e3a45ae91762e1b741629a8e Change-Id: Ie0e2b5840e147f98174cae4521eb777e1a080706
Diffstat (limited to 'tools/aapt2/java/JavaClassGenerator.cpp')
0 files changed, 0 insertions, 0 deletions