Merge "Revert "[HW8] Pull up the processed event."" into lmp-dev

main
Ken Wakasa 2014-07-30 00:32:10 +00:00 committed by Android (Google) Code Review
commit 2ce8799fa8
1 changed files with 5 additions and 5 deletions

View File

@ -712,8 +712,7 @@ public final class InputLogic {
*/ */
private void handleNonSeparator(final SettingsValues settingsValues, private void handleNonSeparator(final SettingsValues settingsValues,
final InputTransaction inputTransaction) { final InputTransaction inputTransaction) {
final Event processedEvent = mWordComposer.processEvent(inputTransaction.mEvent); final int codePoint = inputTransaction.mEvent.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
// which has the same name as other handle* methods but is not the same. // which has the same name as other handle* methods but is not the same.
@ -763,6 +762,7 @@ public final class InputLogic {
resetComposingState(false /* alsoResetLastComposedWord */); resetComposingState(false /* alsoResetLastComposedWord */);
} }
if (isComposingWord) { if (isComposingWord) {
final Event processedEvent = mWordComposer.processEvent(inputTransaction.mEvent);
mWordComposer.applyProcessedEvent(processedEvent); mWordComposer.applyProcessedEvent(processedEvent);
// If it's the first letter, make note of auto-caps state // If it's the first letter, make note of auto-caps state
if (mWordComposer.isSingleLetter()) { if (mWordComposer.isSingleLetter()) {
@ -772,7 +772,7 @@ public final class InputLogic {
mWordComposer.getTypedWord()), 1); mWordComposer.getTypedWord()), 1);
} else { } else {
final boolean swapWeakSpace = tryStripSpaceAndReturnWhetherShouldSwapInstead( final boolean swapWeakSpace = tryStripSpaceAndReturnWhetherShouldSwapInstead(
inputTransaction, processedEvent.isSuggestionStripPress()); inputTransaction, inputTransaction.mEvent.isSuggestionStripPress());
if (swapWeakSpace && trySwapSwapperAndSpace(inputTransaction)) { if (swapWeakSpace && trySwapSwapperAndSpace(inputTransaction)) {
mSpaceState = SpaceState.WEAK; mSpaceState = SpaceState.WEAK;
@ -903,7 +903,6 @@ 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) {
final Event processedEvent = mWordComposer.processEvent(inputTransaction.mEvent);
mSpaceState = SpaceState.NONE; mSpaceState = SpaceState.NONE;
mDeleteCount++; mDeleteCount++;
@ -915,7 +914,7 @@ public final class InputLogic {
// Then again, even in the case of a key repeat, if the cursor is at start of text, it // Then again, even in the case of a key repeat, if the cursor is at start of text, it
// can't go any further back, so we can update right away even if it's a key repeat. // can't go any further back, so we can update right away even if it's a key repeat.
final int shiftUpdateKind = final int shiftUpdateKind =
processedEvent.isKeyRepeat() && mConnection.getExpectedSelectionStart() > 0 inputTransaction.mEvent.isKeyRepeat() && mConnection.getExpectedSelectionStart() > 0
? InputTransaction.SHIFT_UPDATE_LATER : InputTransaction.SHIFT_UPDATE_NOW; ? InputTransaction.SHIFT_UPDATE_LATER : InputTransaction.SHIFT_UPDATE_NOW;
inputTransaction.requireShiftUpdate(shiftUpdateKind); inputTransaction.requireShiftUpdate(shiftUpdateKind);
@ -935,6 +934,7 @@ public final class InputLogic {
mDictionaryFacilitator.removeWordFromPersonalizedDicts(rejectedSuggestion); mDictionaryFacilitator.removeWordFromPersonalizedDicts(rejectedSuggestion);
} }
} else { } else {
final Event processedEvent = mWordComposer.processEvent(inputTransaction.mEvent);
mWordComposer.applyProcessedEvent(processedEvent); mWordComposer.applyProcessedEvent(processedEvent);
} }
if (mWordComposer.isComposingWord()) { if (mWordComposer.isComposingWord()) {