diff options
Diffstat (limited to 'java/src')
3 files changed, 10 insertions, 8 deletions
diff --git a/java/src/com/android/inputmethod/keyboard/KeyboardSwitcher.java b/java/src/com/android/inputmethod/keyboard/KeyboardSwitcher.java index 77218d3bc..cae0edd9f 100644 --- a/java/src/com/android/inputmethod/keyboard/KeyboardSwitcher.java +++ b/java/src/com/android/inputmethod/keyboard/KeyboardSwitcher.java @@ -139,6 +139,12 @@ public class KeyboardSwitcher implements KeyboardState.SwitchActions, mSymbolsShiftedKeyboardId = getKeyboardId(editorInfo, true, true, settingsValues); mState.onLoadKeyboard(mResources.getString(R.string.layout_switch_back_symbols), hasDistinctMultitouch()); + // TODO: Should get rid of this special case handling for Phone Number layouts once we + // have separate layouts with unique KeyboardIds for alphabet and alphabet-shifted + // respectively. + if (mMainKeyboardId.isPhoneKeyboard()) { + mState.onToggleAlphabetAndSymbols(); + } } catch (RuntimeException e) { Log.w(TAG, "loading keyboard failed: " + mMainKeyboardId, e); LatinImeLogger.logOnException(mMainKeyboardId.toString(), e); diff --git a/java/src/com/android/inputmethod/keyboard/internal/KeyboardState.java b/java/src/com/android/inputmethod/keyboard/internal/KeyboardState.java index 292194b4d..623cab303 100644 --- a/java/src/com/android/inputmethod/keyboard/internal/KeyboardState.java +++ b/java/src/com/android/inputmethod/keyboard/internal/KeyboardState.java @@ -265,7 +265,7 @@ public class KeyboardState { public void onUpdateShiftState(boolean autoCaps) { if (DEBUG_STATE) { - Log.d(TAG, "onUpdateShiftState: " + this + " autoCaps=" + autoCaps); + Log.d(TAG, "onUpdateShiftState: autoCaps=" + autoCaps + " " + this); } if (mIsAlphabetMode) { if (!mKeyboardShiftState.isShiftLocked() && !mShiftKeyState.isIgnoring()) { @@ -286,7 +286,7 @@ public class KeyboardState { public void onPressShift(boolean withSliding) { if (DEBUG_STATE) { - Log.d(TAG, "onPressShift: " + this + " sliding=" + withSliding); + Log.d(TAG, "onPressShift: sliding=" + withSliding + " " + this); } if (mIsAlphabetMode) { if (mKeyboardShiftState.isShiftLocked()) { @@ -318,7 +318,7 @@ public class KeyboardState { public void onReleaseShift(boolean withSliding) { if (DEBUG_STATE) { - Log.d(TAG, "onReleaseShift: " + this + " sliding=" + withSliding); + Log.d(TAG, "onReleaseShift: sliding=" + withSliding + " " + this); } if (mIsAlphabetMode) { final boolean isShiftLocked = mKeyboardShiftState.isShiftLocked(); diff --git a/java/src/com/android/inputmethod/latin/LatinIME.java b/java/src/com/android/inputmethod/latin/LatinIME.java index 95fdcc176..711afdfdd 100644 --- a/java/src/com/android/inputmethod/latin/LatinIME.java +++ b/java/src/com/android/inputmethod/latin/LatinIME.java @@ -208,7 +208,6 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar private boolean mHasUncommittedTypedChars; private int mCorrectionMode; - private int mCommittedLength; private String mWordSavedForAutoCorrectCancellation; // Keep track of the last selection range to decide if we need to show word alternatives private int mLastSelectionStart; @@ -1151,7 +1150,6 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar if (ic != null) { ic.commitText(typedWord, 1); } - mCommittedLength = typedWord.length(); TextEntryState.acceptedTyped(typedWord); addToUserUnigramAndBigramDictionaries(typedWord, UserUnigramDictionary.FREQUENCY_FOR_TYPED); @@ -1912,7 +1910,6 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar final CompletionInfo completionInfo = mApplicationSpecifiedCompletions[index]; ic.commitCompletion(completionInfo); } - mCommittedLength = suggestion.length(); if (mSuggestionsView != null) { mSuggestionsView.clear(); } @@ -2032,7 +2029,6 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar } } mHasUncommittedTypedChars = false; - mCommittedLength = bestWord.length(); } private static final WordComposer sEmptyWordComposer = new WordComposer(); @@ -2221,7 +2217,7 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar // "ic" must not be null private void restartSuggestionsOnManuallyPickedTypedWord(final InputConnection ic) { final CharSequence separator = ic.getTextBeforeCursor(1, 0); - final int restartLength = mCommittedLength; + final int restartLength = mWordComposer.size(); if (DEBUG) { final String wordBeforeCursor = ic.getTextBeforeCursor(restartLength + 1, 0).subSequence(0, restartLength) |