am 2706868d: am dc0c3e1e: Merge "Revert "[HW9] Pull the processed event further."" into lmp-dev

* commit '2706868d34362874511492856ea180386e3ea04f':
  Revert "[HW9] Pull the processed event further."
This commit is contained in:
Ken Wakasa 2014-07-30 17:11:28 +00:00 committed by Android Git Automerger
commit e69ca079c5

View file

@ -428,8 +428,7 @@ public final class InputLogic {
// A special key, like delete, shift, emoji, or the settings key. // A special key, like delete, shift, emoji, or the settings key.
switch (event.mKeyCode) { switch (event.mKeyCode) {
case Constants.CODE_DELETE: case Constants.CODE_DELETE:
final Event processedEvent = mWordComposer.processEvent(inputTransaction.mEvent); handleBackspace(inputTransaction, currentKeyboardScriptId);
handleBackspace(inputTransaction, currentKeyboardScriptId, processedEvent);
// Backspace is a functional key, but it affects the contents of the editor. // Backspace is a functional key, but it affects the contents of the editor.
inputTransaction.setDidAffectContents(); inputTransaction.setDidAffectContents();
break; break;
@ -682,14 +681,13 @@ public final class InputLogic {
private boolean handleNonSpecialCharacter(final InputTransaction inputTransaction, private boolean handleNonSpecialCharacter(final InputTransaction inputTransaction,
// TODO: remove this argument // TODO: remove this argument
final LatinIME.UIHandler handler) { final LatinIME.UIHandler handler) {
final Event processedEvent = mWordComposer.processEvent(inputTransaction.mEvent); final int codePoint = inputTransaction.mEvent.mCodePoint;
final int codePoint = processedEvent.mCodePoint;
mSpaceState = SpaceState.NONE; mSpaceState = SpaceState.NONE;
final boolean didAutoCorrect; final boolean didAutoCorrect;
if (inputTransaction.mSettingsValues.isWordSeparator(codePoint) if (inputTransaction.mSettingsValues.isWordSeparator(codePoint)
|| Character.getType(codePoint) == Character.OTHER_SYMBOL) { || Character.getType(codePoint) == Character.OTHER_SYMBOL) {
didAutoCorrect = handleSeparator(inputTransaction, didAutoCorrect = handleSeparator(inputTransaction,
processedEvent.isSuggestionStripPress(), handler); inputTransaction.mEvent.isSuggestionStripPress(), handler);
} else { } else {
didAutoCorrect = false; didAutoCorrect = false;
if (SpaceState.PHANTOM == inputTransaction.mSpaceState) { if (SpaceState.PHANTOM == inputTransaction.mSpaceState) {
@ -702,7 +700,7 @@ public final class InputLogic {
commitTyped(inputTransaction.mSettingsValues, LastComposedWord.NOT_A_SEPARATOR); commitTyped(inputTransaction.mSettingsValues, LastComposedWord.NOT_A_SEPARATOR);
} }
} }
handleNonSeparator(inputTransaction.mSettingsValues, inputTransaction, processedEvent); handleNonSeparator(inputTransaction.mSettingsValues, inputTransaction);
} }
return didAutoCorrect; return didAutoCorrect;
} }
@ -713,9 +711,8 @@ public final class InputLogic {
* @param inputTransaction The transaction in progress. * @param inputTransaction The transaction in progress.
*/ */
private void handleNonSeparator(final SettingsValues settingsValues, private void handleNonSeparator(final SettingsValues settingsValues,
final InputTransaction inputTransaction, final InputTransaction inputTransaction) {
// TODO: remove this arg, put it into the input transaction final Event processedEvent = mWordComposer.processEvent(inputTransaction.mEvent);
final Event processedEvent) {
final int codePoint = processedEvent.mCodePoint; final int codePoint = processedEvent.mCodePoint;
// TODO: refactor this method to stop flipping isComposingWord around all the time, and // TODO: refactor this method to stop flipping isComposingWord around all the time, and
// make it shorter (possibly cut into several pieces). Also factor handleNonSpecialCharacter // 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, private void handleBackspace(final InputTransaction inputTransaction,
// TODO: remove this argument, put it into settingsValues // TODO: remove this argument, put it into settingsValues
final int currentKeyboardScriptId, final int currentKeyboardScriptId) {
// TODO: remove this argument, put it into the transaction final Event processedEvent = mWordComposer.processEvent(inputTransaction.mEvent);
final Event processedEvent) {
mSpaceState = SpaceState.NONE; mSpaceState = SpaceState.NONE;
mDeleteCount++; mDeleteCount++;