Skip to content
Commit cb3c97db 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
Test: Manual. No crash occurs.
Test: atest FrameworksCoreTests:android.widget.TextViewActivityTest

Change-Id: I8dbc92f0f31e64b7e3a45ae91762e1b741629a8e
parent 82dc6147
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