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

Commit 4558068f 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: 92d86d59

am: 4c6d3ba1

Change-Id: I06ed6fea1fe414e7a33694047b0e6e903b7816bb
parents 3273069a 4c6d3ba1
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 =