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

Commit 755c0095 authored by Keisuke Kuroyanagi's avatar Keisuke Kuroyanagi
Browse files

Fix: onExtractedDeleteText deletes unintended region.

InputMethodService#onExtractedDeleteText doesn't reset composing
region and InputConnection#deleteSurroundingText deletes text around
the composing region. As a result, #onExtractedDeleteText can delete
unintended region of the text.
This happens when a user perform Drag&Drop or tap "Delete" in
SuggestionsPopup in full screen extracted mode.

Bug: 22440907
Bug: 27536702
Change-Id: I875f2919896f8ff453a77fb4a1b642ad78079b78
parent 62006a72
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -2269,6 +2269,7 @@ public class InputMethodService extends AbstractInputMethodService {
    public void onExtractedDeleteText(int start, int end) {
        InputConnection conn = getCurrentInputConnection();
        if (conn != null) {
            conn.finishComposingText();
            conn.setSelection(start, start);
            conn.deleteSurroundingText(0, end - start);
        }