From bc56e0442586ecfcbd18cbdd138996b17ea79b6b Mon Sep 17 00:00:00 2001 From: "Tadashi G. Takaoka" Date: Wed, 7 Dec 2011 17:55:22 +0900 Subject: [PATCH] Reset keyboard state when loading keyboard Bug: 5627467 Change-Id: I709f97e47144d3270450adc7d8053038d0df57bc --- .../com/android/inputmethod/keyboard/KeyboardSwitcher.java | 1 + .../inputmethod/keyboard/internal/KeyboardState.java | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/java/src/com/android/inputmethod/keyboard/KeyboardSwitcher.java b/java/src/com/android/inputmethod/keyboard/KeyboardSwitcher.java index 32aabf928..5ae044802 100644 --- a/java/src/com/android/inputmethod/keyboard/KeyboardSwitcher.java +++ b/java/src/com/android/inputmethod/keyboard/KeyboardSwitcher.java @@ -205,6 +205,7 @@ public class KeyboardSwitcher implements SharedPreferences.OnSharedPreferenceCha mMainKeyboardId = getKeyboardId(editorInfo, false, false, settingsValues); mSymbolsKeyboardId = getKeyboardId(editorInfo, true, false, settingsValues); mSymbolsShiftedKeyboardId = getKeyboardId(editorInfo, true, true, settingsValues); + mState.onLoadKeyboard(); mLayoutSwitchBackSymbols = mResources.getString(R.string.layout_switch_back_symbols); setKeyboard(getKeyboard(mSavedKeyboardState.getKeyboardId())); mSavedKeyboardState.restore(); diff --git a/java/src/com/android/inputmethod/keyboard/internal/KeyboardState.java b/java/src/com/android/inputmethod/keyboard/internal/KeyboardState.java index fd7e77863..b9450c643 100644 --- a/java/src/com/android/inputmethod/keyboard/internal/KeyboardState.java +++ b/java/src/com/android/inputmethod/keyboard/internal/KeyboardState.java @@ -27,6 +27,13 @@ public class KeyboardState { public KeyboardState() { } + public void onLoadKeyboard() { + mKeyboardShiftState.setShifted(false); + mKeyboardShiftState.setShiftLocked(false); + mShiftKeyState.onRelease(); + mSymbolKeyState.onRelease(); + } + public boolean isShiftLocked() { return mKeyboardShiftState.isShiftLocked(); }