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

Commit 92291eea authored by Jean Chalard's avatar Jean Chalard Committed by Android (Google) Code Review
Browse files

Merge changes I3109a482,Ia5e25738

* changes:
  Final small cleanup.
  Actually change the place where updateSelection is called
parents 79386f4f aaf8671c
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -268,8 +268,9 @@ public class BaseInputConnection implements InputConnection {
        if (content != null) {
            beginBatchEdit();
            removeComposingSpans(content);
            endBatchEdit();
            // Note: sendCurrentText does nothing unless mDummyMode is set
            sendCurrentText();
            endBatchEdit();
        }
        return true;
    }
@@ -466,8 +467,9 @@ public class BaseInputConnection implements InputConnection {
            content.setSpan(COMPOSING, a, b,
                    Spanned.SPAN_EXCLUSIVE_EXCLUSIVE | Spanned.SPAN_COMPOSING);

            endBatchEdit();
            // Note: sendCurrentText does nothing unless mDummyMode is set
            sendCurrentText();
            endBatchEdit();
        }
        return true;
    }
+6 −6
Original line number Diff line number Diff line
@@ -1085,9 +1085,12 @@ public class Editor {
            mTextView.updateAfterEdit();
            reportExtractedText();
        } else if (ims.mCursorChanged) {
            // Cheezy way to get us to report the current cursor location.
            // Cheesy way to get us to report the current cursor location.
            mTextView.invalidateCursor();
        }
        // sendUpdateSelection knows to avoid sending if the selection did
        // not actually change.
        sendUpdateSelection();
    }

    static final int EXTRACT_NOTHING = -2;
@@ -1221,6 +1224,8 @@ public class Editor {
                    candStart = EditableInputConnection.getComposingSpanStart(sp);
                    candEnd = EditableInputConnection.getComposingSpanEnd(sp);
                }
                // InputMethodManager#updateSelection skips sending the message if
                // none of the parameters have changed since the last time we called it.
                imm.updateSelection(mTextView,
                        selectionStart, selectionEnd, candStart, candEnd);
            }
@@ -1244,11 +1249,6 @@ public class Editor {
                        // input method.
                        reported = reportExtractedText();
                    }
                    if (!reported && highlight != null) {
                        // TODO: stop doing this here, and do it after each change
                        // as needed instead.
                        sendUpdateSelection();
                    }
                }

                if (imm.isWatchingCursor(mTextView) && highlight != null) {