From 79fd911c8d816d192d6a799fd3e3e2cb406671b0 Mon Sep 17 00:00:00 2001 From: Ken Wakasa Date: Wed, 30 Jul 2014 00:29:41 +0000 Subject: [PATCH] Revert "[HW10] Pull the processed event in its eventual place" This reverts commit bcb61da581edfef5120a7a38a5de98d35fa65255. Reverting due to a few critical bugs and unit test failures. Change-Id: I5f7ee2c7883496ed36e56b3ef12fac91f85f9866 --- .../inputmethod/latin/inputlogic/InputLogic.java | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java b/java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java index cb8b9c4db..82a7660e1 100644 --- a/java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java +++ b/java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java @@ -405,7 +405,6 @@ public final class InputLogic { final int keyboardShiftMode, // TODO: remove these arguments final int currentKeyboardScriptId, final LatinIME.UIHandler handler) { - final Event processedEvent = mWordComposer.processEvent(event); final InputTransaction inputTransaction = new InputTransaction(settingsValues, event, SystemClock.uptimeMillis(), mSpaceState, getActualCapsMode(settingsValues, keyboardShiftMode)); @@ -429,6 +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); // Backspace is a functional key, but it affects the contents of the editor. inputTransaction.setDidAffectContents(); @@ -484,7 +484,7 @@ public final class InputLogic { inputTransaction.mSettingsValues, tmpEvent, inputTransaction.mTimestamp, inputTransaction.mSpaceState, inputTransaction.mShiftState); - didAutoCorrect = handleNonSpecialCharacter(tmpTransaction, handler, processedEvent); + didAutoCorrect = handleNonSpecialCharacter(tmpTransaction, handler); // Shift + Enter is treated as a functional key but it results in adding a new // line, so that does affect the contents of the editor. inputTransaction.setDidAffectContents(); @@ -515,13 +515,11 @@ public final class InputLogic { } else { // No action label, and the action from imeOptions is NONE: this is a regular // enter key that should input a carriage return. - didAutoCorrect = handleNonSpecialCharacter(inputTransaction, handler, - processedEvent); + didAutoCorrect = handleNonSpecialCharacter(inputTransaction, handler); } break; default: - didAutoCorrect = handleNonSpecialCharacter(inputTransaction, handler, - processedEvent); + didAutoCorrect = handleNonSpecialCharacter(inputTransaction, handler); break; } } @@ -683,9 +681,8 @@ public final class InputLogic { */ private boolean handleNonSpecialCharacter(final InputTransaction inputTransaction, // TODO: remove this argument - final LatinIME.UIHandler handler, - // TODO: remove this argument, put it inside the transaction - final Event processedEvent) { + final LatinIME.UIHandler handler) { + final Event processedEvent = mWordComposer.processEvent(inputTransaction.mEvent); final int codePoint = processedEvent.mCodePoint; mSpaceState = SpaceState.NONE; final boolean didAutoCorrect;