Fix a pernicious bug with caps.

What's happening here is, setAlphabetKeyboard sets the
keyboard to AUTOMATIC_SHIFTED and updates the keyboard, then
restoring the keyboard old state sets it back to UNSHIFTED without
updating it. When we finally know what the correct value is,
we try to set it to UNSHIFTED, but since that's already the currently
recorded state, it skips updating the keyboard forever.

The solution is to avoid setting the shift state without updating the
keyboard.

Bug: 10948582
Change-Id: Ic8670401e378f8284e851281f91a9ad93eac8e90
main
Jean Chalard 2013-10-02 15:58:21 +09:00
parent 74577bedb3
commit f735117d36
2 changed files with 3 additions and 0 deletions

View File

@ -178,6 +178,8 @@ public final class KeyboardState {
if (!state.mIsAlphabetShiftLocked) { if (!state.mIsAlphabetShiftLocked) {
setShifted(state.mShiftMode); setShifted(state.mShiftMode);
} }
// TODO: is this the right place to do this? Should we do this in setShift* instead?
mSwitchActions.requestUpdatingShiftState();
} else { } else {
mPrevMainKeyboardWasShiftLocked = state.mIsAlphabetShiftLocked; mPrevMainKeyboardWasShiftLocked = state.mIsAlphabetShiftLocked;
} }

View File

@ -2929,6 +2929,7 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
return; return;
} }
tryFixLyingCursorPosition(); tryFixLyingCursorPosition();
mKeyboardSwitcher.updateShiftState();
if (tryResumeSuggestions) mHandler.postResumeSuggestions(); if (tryResumeSuggestions) mHandler.postResumeSuggestions();
} }