From e2397e54c6b676752451ac40335bcf104556975e Mon Sep 17 00:00:00 2001 From: Ken Wakasa Date: Wed, 30 Jul 2014 00:31:12 +0000 Subject: [PATCH] Revert "[HW9] Pull the processed event further." This reverts commit a8d80ec01202633709d161fb01df0126602d4eb6. Reverting due to a few critical bugs and unit test failures. Change-Id: I3f49b54f34d875e8986d6ddc2523ab0b706dc6f2 --- .../latin/inputlogic/InputLogic.java | 20 ++++++++----------- 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java b/java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java index 82a7660e1..f2a6f3b2e 100644 --- a/java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java +++ b/java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java @@ -428,8 +428,7 @@ public final class InputLogic { // A special key, like delete, shift, emoji, or the settings key. switch (event.mKeyCode) { case Constants.CODE_DELETE: - final Event processedEvent = mWordComposer.processEvent(inputTransaction.mEvent); - handleBackspace(inputTransaction, currentKeyboardScriptId, processedEvent); + handleBackspace(inputTransaction, currentKeyboardScriptId); // Backspace is a functional key, but it affects the contents of the editor. inputTransaction.setDidAffectContents(); break; @@ -682,14 +681,13 @@ public final class InputLogic { private boolean handleNonSpecialCharacter(final InputTransaction inputTransaction, // TODO: remove this argument final LatinIME.UIHandler handler) { - final Event processedEvent = mWordComposer.processEvent(inputTransaction.mEvent); - final int codePoint = processedEvent.mCodePoint; + final int codePoint = inputTransaction.mEvent.mCodePoint; mSpaceState = SpaceState.NONE; final boolean didAutoCorrect; if (inputTransaction.mSettingsValues.isWordSeparator(codePoint) || Character.getType(codePoint) == Character.OTHER_SYMBOL) { didAutoCorrect = handleSeparator(inputTransaction, - processedEvent.isSuggestionStripPress(), handler); + inputTransaction.mEvent.isSuggestionStripPress(), handler); } else { didAutoCorrect = false; if (SpaceState.PHANTOM == inputTransaction.mSpaceState) { @@ -702,7 +700,7 @@ public final class InputLogic { commitTyped(inputTransaction.mSettingsValues, LastComposedWord.NOT_A_SEPARATOR); } } - handleNonSeparator(inputTransaction.mSettingsValues, inputTransaction, processedEvent); + handleNonSeparator(inputTransaction.mSettingsValues, inputTransaction); } return didAutoCorrect; } @@ -713,9 +711,8 @@ public final class InputLogic { * @param inputTransaction The transaction in progress. */ private void handleNonSeparator(final SettingsValues settingsValues, - final InputTransaction inputTransaction, - // TODO: remove this arg, put it into the input transaction - final Event processedEvent) { + final InputTransaction inputTransaction) { + final Event processedEvent = mWordComposer.processEvent(inputTransaction.mEvent); final int codePoint = processedEvent.mCodePoint; // TODO: refactor this method to stop flipping isComposingWord around all the time, and // make it shorter (possibly cut into several pieces). Also factor handleNonSpecialCharacter @@ -905,9 +902,8 @@ public final class InputLogic { */ private void handleBackspace(final InputTransaction inputTransaction, // TODO: remove this argument, put it into settingsValues - final int currentKeyboardScriptId, - // TODO: remove this argument, put it into the transaction - final Event processedEvent) { + final int currentKeyboardScriptId) { + final Event processedEvent = mWordComposer.processEvent(inputTransaction.mEvent); mSpaceState = SpaceState.NONE; mDeleteCount++;