From 999368ef0c6eb55ab65f288401a35011b73126f3 Mon Sep 17 00:00:00 2001 From: "Tadashi G. Takaoka" Date: Mon, 26 Jul 2010 16:31:38 -0700 Subject: Updating keyboard ids must happen everytime makeKeyboards() is called In makeKeyboards(), there is a fall through pass in which the keyboards' id (mSymbolsId and mSymbolsShiftedId) will not be updated. Then in toggleShift(), current keyboard id (mCurrentId) will not match any of two and nothing happens. Bug: 2825858 Change-Id: Iaf8a7368f513b35cf77a67794ecd3e21aa08484b --- java/src/com/android/inputmethod/latin/KeyboardSwitcher.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'java/src') diff --git a/java/src/com/android/inputmethod/latin/KeyboardSwitcher.java b/java/src/com/android/inputmethod/latin/KeyboardSwitcher.java index bbde23221..95068e6cb 100644 --- a/java/src/com/android/inputmethod/latin/KeyboardSwitcher.java +++ b/java/src/com/android/inputmethod/latin/KeyboardSwitcher.java @@ -129,6 +129,9 @@ public class KeyboardSwitcher implements SharedPreferences.OnSharedPreferenceCha } void makeKeyboards(boolean forceCreate) { + mSymbolsId = makeSymbolsId(mHasVoice && !mVoiceOnPrimary); + mSymbolsShiftedId = makeSymbolsShiftedId(mHasVoice && !mVoiceOnPrimary); + if (forceCreate) mKeyboards.clear(); // Configuration change is coming after the keyboard gets recreated. So don't rely on that. // If keyboards have already been made, check if we have a screen width change and @@ -137,8 +140,6 @@ public class KeyboardSwitcher implements SharedPreferences.OnSharedPreferenceCha if (displayWidth == mLastDisplayWidth) return; mLastDisplayWidth = displayWidth; if (!forceCreate) mKeyboards.clear(); - mSymbolsId = makeSymbolsId(mHasVoice && !mVoiceOnPrimary); - mSymbolsShiftedId = makeSymbolsShiftedId(mHasVoice && !mVoiceOnPrimary); } /** @@ -338,7 +339,7 @@ public class KeyboardSwitcher implements SharedPreferences.OnSharedPreferenceCha LatinKeyboard symbolsShiftedKeyboard = getKeyboard(mSymbolsShiftedId); symbolsShiftedKeyboard.setShifted(false); mCurrentId = mSymbolsId; - mInputView.setKeyboard(getKeyboard(mSymbolsId)); + mInputView.setKeyboard(symbolsKeyboard); symbolsKeyboard.setShifted(false); symbolsKeyboard.setImeOptions(mContext.getResources(), mMode, mImeOptions); } -- cgit v1.2.3-83-g751a