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

Commit 617c83bc authored by Koki Ryu's avatar Koki Ryu Committed by Android (Google) Code Review
Browse files

Merge "Handle emojis with emoji-modifier and zwj properly on backspace"

parents 23ff6170 5aedeaf8
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -229,6 +229,8 @@ public abstract class BaseKeyListener extends MetaKeyKeyListener
                        break;
                    } else if (Emoji.isEmojiModifierBase(codePoint)) {
                        deleteCharCount += Character.charCount(codePoint);
                        state = STATE_BEFORE_EMOJI;
                        break;
                    }
                    state = STATE_FINISHED;
                    break;
+5 −1
Original line number Diff line number Diff line
@@ -193,11 +193,15 @@ public class BackspaceTest {
        backspace(state, 0);
        state.assertEquals("|");

        // Emoji modifier can be appended to the first emoji.
        // Emoji modifier can be appended to each emoji.
        state.setByString("U+1F469 U+1F3FB U+200D U+1F4BC |");
        backspace(state, 0);
        state.assertEquals("|");

        state.setByString("U+1F468 U+1F3FF U+200D U+2764 U+FE0F U+200D U+1F468 U+1F3FB |");
        backspace(state, 0);
        state.assertEquals("|");

        // End with ZERO WIDTH JOINER
        state.setByString("U+1F441 U+200D |");
        backspace(state, 0);