diff options
author | 2010-06-01 16:13:29 +0900 | |
---|---|---|
committer | 2010-06-01 17:07:39 +0900 | |
commit | e607db631d33b15c4ce451782023f8c5f7ef5044 (patch) | |
tree | 1d37d986e9d840f02f37c8bbb5fb677ea9d5d329 /java/src/com/android/inputmethod/latin/KeyboardSwitcher.java | |
parent | 7c00957e4635a8edd6a5f0525b12acac5e627a07 (diff) | |
download | latinime-e607db631d33b15c4ce451782023f8c5f7ef5044.tar.gz latinime-e607db631d33b15c4ce451782023f8c5f7ef5044.tar.xz latinime-e607db631d33b15c4ce451782023f8c5f7ef5044.zip |
Get the log of exceptions. And delete the gradient background.
- Add a logger of Exception
- Catch RuntimeException where bug reported.
- Delete gradient background.
Change-Id: I98b5fbc4a51163de7e56bee4f8312585d8e98eb7
Diffstat (limited to 'java/src/com/android/inputmethod/latin/KeyboardSwitcher.java')
-rw-r--r-- | java/src/com/android/inputmethod/latin/KeyboardSwitcher.java | 39 |
1 files changed, 18 insertions, 21 deletions
diff --git a/java/src/com/android/inputmethod/latin/KeyboardSwitcher.java b/java/src/com/android/inputmethod/latin/KeyboardSwitcher.java index fefe1cc42..3eb135ebe 100644 --- a/java/src/com/android/inputmethod/latin/KeyboardSwitcher.java +++ b/java/src/com/android/inputmethod/latin/KeyboardSwitcher.java @@ -212,8 +212,12 @@ public class KeyboardSwitcher implements SharedPreferences.OnSharedPreferenceCha mInputView.setPreviewEnabled(true); KeyboardId id = getKeyboardId(mode, imeOptions, isSymbols); - - LatinKeyboard keyboard = getKeyboard(id); + LatinKeyboard keyboard = null; + try { + keyboard = getKeyboard(id); + } catch (RuntimeException e) { + LatinImeLogger.logOnException(mode + "," + imeOptions + "," + isSymbols, e); + } if (mode == MODE_PHONE) { mInputView.setPhoneKeyboard(keyboard); @@ -271,12 +275,11 @@ public class KeyboardSwitcher implements SharedPreferences.OnSharedPreferenceCha } switch (mode) { case MODE_TEXT: - if (mTextMode == MODE_TEXT_QWERTY) { - return new KeyboardId(keyboardRowsResId, KEYBOARDMODE_NORMAL, true, hasVoice); - } else if (mTextMode == MODE_TEXT_ALPHA) { + if (mTextMode == MODE_TEXT_ALPHA) { return new KeyboardId(R.xml.kbd_alpha, KEYBOARDMODE_NORMAL, true, hasVoice); } - break; + // Normally mTextMode should be MODE_TEXT_QWERTY. + return new KeyboardId(keyboardRowsResId, KEYBOARDMODE_NORMAL, true, hasVoice); case MODE_SYMBOLS: return makeSymbolsId(hasVoice); case MODE_PHONE: @@ -301,19 +304,6 @@ public class KeyboardSwitcher implements SharedPreferences.OnSharedPreferenceCha return mMode == MODE_TEXT; } - int getTextMode() { - return mTextMode; - } - - void setTextMode(int position) { - if (position < MODE_TEXT_COUNT && position >= 0) { - mTextMode = position; - } - if (isTextMode()) { - setKeyboardMode(MODE_TEXT, mImeOptions, mHasVoice); - } - } - int getTextModeCount() { return MODE_TEXT_COUNT; } @@ -387,11 +377,18 @@ public class KeyboardSwitcher implements SharedPreferences.OnSharedPreferenceCha private void changeLatinKeyboardView(int newLayout, boolean forceReset) { if (mLayoutId != newLayout || mInputView == null || forceReset) { + if (mInputView != null) { + mInputView.closing(); + } if (LAYOUTS.length <= newLayout) { newLayout = Integer.valueOf(DEFAULT_LAYOUT_ID); } - mInputView = (LatinKeyboardView) mInputMethodService.getLayoutInflater().inflate( - LAYOUTS[newLayout], null); + try { + mInputView = (LatinKeyboardView) mInputMethodService.getLayoutInflater().inflate( + LAYOUTS[newLayout], null); + } catch (RuntimeException e) { + LatinImeLogger.logOnException(mLayoutId + "," + newLayout, e); + } mInputView.setExtentionLayoutResId(LAYOUTS[newLayout]); mInputView.setOnKeyboardActionListener(mInputMethodService); mLayoutId = newLayout; |