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

Commit 5e04b365 authored by Siyamed Sinir's avatar Siyamed Sinir Committed by android-build-merger
Browse files

Merge "Fix crash during TextView.onCreateContextMenu" into oc-dev am: 58df6ab9

am: 04171ecb

Change-Id: I3306e0fd1a7fdf211e330c0a53787f9b1eb5ef1c
parents a24fdfd3 04171ecb
Loading
Loading
Loading
Loading
+11 −7
Original line number Diff line number Diff line
@@ -2584,15 +2584,19 @@ public class Editor {
        if (offset == -1) {
            return;
        }

        stopTextActionModeWithPreservingSelection();
        if (mTextView.canSelectText()) {
            final boolean isOnSelection = mTextView.hasSelection()
                && offset >= mTextView.getSelectionStart() && offset <= mTextView.getSelectionEnd();
                    && offset >= mTextView.getSelectionStart()
                    && offset <= mTextView.getSelectionEnd();
            if (!isOnSelection) {
                // Right clicked position is not on the selection. Remove the selection and move the
                // cursor to the right clicked position.
                Selection.setSelection((Spannable) mTextView.getText(), offset);
                stopTextActionMode();
            }
        }

        if (shouldOfferToShowSuggestions()) {
            final SuggestionInfo[] suggestionInfoArray =