Skip to content
Commit 6dfbe831 authored by Joanne Chung's avatar Joanne Chung
Browse files

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 cb3c97db)

Merged-In: I8dbc92f0f31e64b7e3a45ae91762e1b741629a8e
Change-Id: Ie0e2b5840e147f98174cae4521eb777e1a080706
parent 1835a248
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