am 0b51fac9: Merge "Only update shift state if left in auto mode."

* commit '0b51fac907831c2f48290342294b11ae9caaaecb':
  Only update shift state if left in auto mode.
main
Jean Chalard 2013-12-13 08:34:12 -08:00 committed by Android Git Automerger
commit 3ac8ec6b03
1 changed files with 10 additions and 1 deletions

View File

@ -1793,10 +1793,19 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
final int codePointBeforeCursor = mConnection.getCodePointBeforeCursor(); final int codePointBeforeCursor = mConnection.getCodePointBeforeCursor();
if (Character.isLetterOrDigit(codePointBeforeCursor) if (Character.isLetterOrDigit(codePointBeforeCursor)
|| currentSettingsValues.isUsuallyFollowedBySpace(codePointBeforeCursor)) { || currentSettingsValues.isUsuallyFollowedBySpace(codePointBeforeCursor)) {
final boolean autoShiftHasBeenOverriden = mKeyboardSwitcher.getKeyboardShiftMode() !=
getCurrentAutoCapsState();
mSpaceState = SPACE_STATE_PHANTOM; mSpaceState = SPACE_STATE_PHANTOM;
if (!autoShiftHasBeenOverriden) {
// When we change the space state, we need to update the shift state of the
// keyboard unless it has been overridden manually. This is happening for example
// 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.
mKeyboardSwitcher.updateShiftState();
}
} }
mConnection.endBatchEdit(); mConnection.endBatchEdit();
mKeyboardSwitcher.updateShiftState();
mWordComposer.setCapitalizedModeAndPreviousWordAtStartComposingTime(getActualCapsMode(), mWordComposer.setCapitalizedModeAndPreviousWordAtStartComposingTime(getActualCapsMode(),
// Prev word is 1st word before cursor // Prev word is 1st word before cursor
getNthPreviousWordForSuggestion(currentSettingsValues, 1 /* nthPreviousWord */)); getNthPreviousWordForSuggestion(currentSettingsValues, 1 /* nthPreviousWord */));