Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f6ca7fab authored by Android (Google) Code Review's avatar Android (Google) Code Review
Browse files

Merge change 23690 into eclair

* changes:
  Prevent a crash when webkit changes the selection.
parents 010bed74 ef92e7a6
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -697,8 +697,12 @@ import java.util.ArrayList;
     * Set the selection, and disable our onSelectionChanged action.
     */
    /* package */ void setSelectionFromWebKit(int start, int end) {
        if (start < 0 || end < 0) return;
        Spannable text = (Spannable) getText();
        int length = text.length();
        if (start > length || end > length) return;
        mFromWebKit = true;
        Selection.setSelection((Spannable) getText(), start, end);
        Selection.setSelection(text, start, end);
        mFromWebKit = false;
    }