[IL132] Remove some calls that let a value escape.

Bug: 8636060
Change-Id: I696514934586ee71e734fd974026af8b2c866127
main
Jean Chalard 2014-03-27 18:26:36 +09:00
parent 7ebd7ca9a4
commit 9320553ab9
3 changed files with 16 additions and 23 deletions

View File

@ -219,22 +219,15 @@ public final class KeyboardSwitcher implements KeyboardState.SwitchActions {
return null;
}
/**
* Update keyboard shift state triggered by connected EditText status change.
*/
public void updateShiftState() {
mState.onUpdateShiftState(mLatinIME.getCurrentAutoCapsState(),
mLatinIME.getCurrentRecapitalizeState());
}
// TODO: Remove this method. Come up with a more comprehensive way to reset the keyboard layout
// when a keyboard layout set doesn't get reloaded in LatinIME.onStartInputViewInternal().
public void resetKeyboardStateToAlphabet() {
mState.onResetKeyboardStateToAlphabet();
}
public void onPressKey(final int code, final boolean isSinglePointer) {
mState.onPressKey(code, isSinglePointer, mLatinIME.getCurrentAutoCapsState());
public void onPressKey(final int code, final boolean isSinglePointer,
final int currentAutoCapsState) {
mState.onPressKey(code, isSinglePointer, currentAutoCapsState);
}
public void onReleaseKey(final int code, final boolean withSliding) {
@ -338,8 +331,8 @@ public final class KeyboardSwitcher implements KeyboardState.SwitchActions {
/**
* Updates state machine to figure out when to automatically switch back to the previous mode.
*/
public void onCodeInput(final int code) {
mState.onCodeInput(code, mLatinIME.getCurrentAutoCapsState());
public void onCodeInput(final int code, final int currentAutoCapsState) {
mState.onCodeInput(code, currentAutoCapsState);
}
public boolean isShowingEmojiPalettes() {

View File

@ -197,7 +197,7 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
latinIme.mSettings.getCurrent());
break;
case MSG_UPDATE_SHIFT_STATE:
switcher.updateShiftState();
switcher.requestUpdatingShiftState();
break;
case MSG_SHOW_GESTURE_PREVIEW_AND_SUGGESTION_STRIP:
if (msg.arg1 == ARG1_NOT_GESTURE_INPUT) {
@ -833,7 +833,7 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
// we need to re-evaluate the shift state, but not the whole layout which would be
// disruptive.
// Space state must be updated before calling updateShiftState
switcher.updateShiftState();
switcher.requestUpdatingShiftState();
}
// This will set the punctuation suggestions if next word suggestion is off;
// otherwise it will clear the suggestion strip.
@ -912,7 +912,7 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
// TODO: find a better way to simulate actual execution.
if (isInputViewShown() &&
mInputLogic.onUpdateSelection(oldSelStart, oldSelEnd, newSelStart, newSelEnd)) {
mKeyboardSwitcher.updateShiftState();
mKeyboardSwitcher.requestUpdatingShiftState();
}
mSubtypeState.currentSubtypeUsed();
@ -1231,7 +1231,7 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
mInputLogic.onCodeInput(mSettings.getCurrent(), event,
mKeyboardSwitcher.getKeyboardShiftMode(), mHandler);
updateStateAfterInputTransaction(completeInputTransaction);
mKeyboardSwitcher.onCodeInput(codePoint);
mKeyboardSwitcher.onCodeInput(codePoint, getCurrentAutoCapsState());
}
// A helper method to split the code point and the key code. Ultimately, they should not be
@ -1256,8 +1256,8 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
// TODO: have the keyboard pass the correct key code when we need it.
final Event event = Event.createSoftwareTextEvent(rawText, Event.NOT_A_KEY_CODE);
mInputLogic.onTextInput(mSettings.getCurrent(), event, mHandler);
mKeyboardSwitcher.updateShiftState();
mKeyboardSwitcher.onCodeInput(Constants.CODE_OUTPUT_TEXT);
mKeyboardSwitcher.requestUpdatingShiftState();
mKeyboardSwitcher.onCodeInput(Constants.CODE_OUTPUT_TEXT, getCurrentAutoCapsState());
}
@Override
@ -1500,7 +1500,7 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
mHandler.postUpdateShiftState();
break;
case InputTransaction.SHIFT_UPDATE_NOW:
mKeyboardSwitcher.updateShiftState();
mKeyboardSwitcher.requestUpdatingShiftState();
break;
default: // SHIFT_NO_UPDATE
}
@ -1540,7 +1540,7 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
@Override
public void onPressKey(final int primaryCode, final int repeatCount,
final boolean isSinglePointer) {
mKeyboardSwitcher.onPressKey(primaryCode, isSinglePointer);
mKeyboardSwitcher.onPressKey(primaryCode, isSinglePointer, getCurrentAutoCapsState());
hapticAndAudioFeedback(primaryCode, repeatCount);
}

View File

@ -537,7 +537,7 @@ public final class InputLogic {
// after typing some letters and a period, then gesturing; the keyboard is not in
// caps mode yet, but since a gesture is starting, it should go in caps mode,
// unless the user explictly said it should not.
keyboardSwitcher.updateShiftState();
keyboardSwitcher.requestUpdatingShiftState();
}
}
mConnection.endBatchEdit();
@ -579,7 +579,7 @@ public final class InputLogic {
promotePhantomSpace(settingsValues);
mConnection.commitText(commitParts[0], 0);
mSpaceState = SpaceState.PHANTOM;
keyboardSwitcher.updateShiftState();
keyboardSwitcher.requestUpdatingShiftState();
mWordComposer.setCapitalizedModeAndPreviousWordAtStartComposingTime(
getActualCapsMode(settingsValues,
keyboardSwitcher.getKeyboardShiftMode()), commitParts[0]);
@ -1821,7 +1821,7 @@ public final class InputLogic {
}
// Space state must be updated before calling updateShiftState
mSpaceState = SpaceState.PHANTOM;
keyboardSwitcher.updateShiftState();
keyboardSwitcher.requestUpdatingShiftState();
}
/**