Skip to content
Snippets Groups Projects
Commit aa5d6fe0 authored by Ken Wakasa's avatar Ken Wakasa Committed by Android Git Automerger
Browse files

am 9cc22c45: am 5d2556b9: Reset the IME if requested by the app.

* commit '9cc22c45':
  Reset the IME if requested by the app.
parents 4d095547 9cc22c45
No related branches found
No related tags found
No related merge requests found
...@@ -200,6 +200,12 @@ public final class KeyboardSwitcher implements KeyboardState.SwitchActions { ...@@ -200,6 +200,12 @@ public final class KeyboardSwitcher implements KeyboardState.SwitchActions {
mState.onUpdateShiftState(mLatinIME.getCurrentAutoCapsState()); mState.onUpdateShiftState(mLatinIME.getCurrentAutoCapsState());
} }
// TODO: Remove this method. Come up with a more comprehensive way to reset the keyboard layout
// when a keyboard layout set doesn't get reloaded in LatinIME.onStartInputViewInternal().
public void resetKeyboardStateToAlphabet() {
mState.onResetKeyboardStateToAlphabet();
}
public void onPressKey(int code) { public void onPressKey(int code) {
if (isVibrateAndSoundFeedbackRequired()) { if (isVibrateAndSoundFeedbackRequired()) {
mLatinIME.hapticAndAudioFeedback(code); mLatinIME.hapticAndAudioFeedback(code);
......
...@@ -254,6 +254,22 @@ public final class KeyboardState { ...@@ -254,6 +254,22 @@ public final class KeyboardState {
} }
} }
// TODO: Remove this method. Come up with a more comprehensive way to reset the keyboard layout
// when a keyboard layout set doesn't get reloaded in LatinIME.onStartInputViewInternal().
private void resetKeyboardStateToAlphabet() {
if (DEBUG_ACTION) {
Log.d(TAG, "resetKeyboardStateToAlphabet: " + this);
}
if (mIsAlphabetMode) return;
mPrevSymbolsKeyboardWasShifted = mIsSymbolShifted;
setAlphabetKeyboard();
if (mPrevMainKeyboardWasShiftLocked) {
setShiftLocked(true);
}
mPrevMainKeyboardWasShiftLocked = false;
}
private void toggleShiftInSymbols() { private void toggleShiftInSymbols() {
if (mIsSymbolShifted) { if (mIsSymbolShifted) {
setSymbolsKeyboard(); setSymbolsKeyboard();
...@@ -380,6 +396,15 @@ public final class KeyboardState { ...@@ -380,6 +396,15 @@ public final class KeyboardState {
updateAlphabetShiftState(autoCaps); updateAlphabetShiftState(autoCaps);
} }
// TODO: Remove this method. Come up with a more comprehensive way to reset the keyboard layout
// when a keyboard layout set doesn't get reloaded in LatinIME.onStartInputViewInternal().
public void onResetKeyboardStateToAlphabet() {
if (DEBUG_EVENT) {
Log.d(TAG, "onResetKeyboardStateToAlphabet: " + this);
}
resetKeyboardStateToAlphabet();
}
private void updateAlphabetShiftState(int autoCaps) { private void updateAlphabetShiftState(int autoCaps) {
if (!mIsAlphabetMode) return; if (!mIsAlphabetMode) return;
if (!mShiftKeyState.isReleasing()) { if (!mShiftKeyState.isReleasing()) {
......
...@@ -732,6 +732,10 @@ public final class LatinIME extends InputMethodService implements KeyboardAction ...@@ -732,6 +732,10 @@ public final class LatinIME extends InputMethodService implements KeyboardAction
} }
switcher.loadKeyboard(editorInfo, mCurrentSettings); switcher.loadKeyboard(editorInfo, mCurrentSettings);
} else if (restarting) {
// TODO: Come up with a more comprehensive way to reset the keyboard layout when
// a keyboard layout set doesn't get reloaded in this method.
switcher.resetKeyboardStateToAlphabet();
} }
setSuggestionStripShownInternal( setSuggestionStripShownInternal(
isSuggestionsStripVisible(), /* needsInputViewShown */ false); isSuggestionsStripVisible(), /* needsInputViewShown */ false);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment