diff options
author | 2014-08-06 18:34:59 +0900 | |
---|---|---|
committer | 2014-08-06 18:36:55 +0900 | |
commit | 1f3d89c2af645a85d863083ff7956a5ca7e1abc7 (patch) | |
tree | 7ff6bdb06d1c19eeba2eeaee5eb2daec6028aefc /java/src | |
parent | 772a8019efbc280f6228fc2d7baca66f5dee755e (diff) | |
download | latinime-1f3d89c2af645a85d863083ff7956a5ca7e1abc7.tar.gz latinime-1f3d89c2af645a85d863083ff7956a5ca7e1abc7.tar.xz latinime-1f3d89c2af645a85d863083ff7956a5ca7e1abc7.zip |
Revert "[HS1] Save some data in startInputView"
This reverts commit f1accd4f04b13f764e1ffa7c7964e4b7c41ddf4b.
Bug: 16830599
Change-Id: I4c9367f742b8ee8463920e91263b05c2195f8480
Diffstat (limited to 'java/src')
-rw-r--r-- | java/src/com/android/inputmethod/latin/LatinIME.java | 36 |
1 files changed, 7 insertions, 29 deletions
diff --git a/java/src/com/android/inputmethod/latin/LatinIME.java b/java/src/com/android/inputmethod/latin/LatinIME.java index 850d5efe0..f67c2a356 100644 --- a/java/src/com/android/inputmethod/latin/LatinIME.java +++ b/java/src/com/android/inputmethod/latin/LatinIME.java @@ -752,34 +752,8 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen loadKeyboard(); } - /** - * A class that holds information to pass from onStartInputInternal to onStartInputViewInternal - * - * OnStartInput needs to reload the settings and that will prevent onStartInputViewInternal - * from comparing the old settings with the new ones, so we use this memory to pass the - * necessary information along. - */ - private static class EditorChangeInfo { - public final boolean mIsSameInputType; - public final boolean mHasSameOrientation; - public EditorChangeInfo(final boolean isSameInputType, final boolean hasSameOrientation) { - mIsSameInputType = isSameInputType; - mHasSameOrientation = hasSameOrientation; - } - } - - private EditorChangeInfo mLastEditorChangeInfo; - private void onStartInputInternal(final EditorInfo editorInfo, final boolean restarting) { super.onStartInput(editorInfo, restarting); - if (editorInfo == null) { - Log.e(TAG, "Null EditorInfo in onStartInput()"); - return; - } - SettingsValues currentSettingsValues = mSettings.getCurrent(); - mLastEditorChangeInfo = new EditorChangeInfo( - currentSettingsValues.isSameInputType(editorInfo), - currentSettingsValues.hasSameOrientation(getResources().getConfiguration())); } @SuppressWarnings("deprecation") @@ -789,6 +763,9 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen final KeyboardSwitcher switcher = mKeyboardSwitcher; switcher.updateKeyboardTheme(); final MainKeyboardView mainKeyboardView = switcher.getMainKeyboardView(); + // If we are starting input in a different text field from before, we'll have to reload + // settings, so currentSettingsValues can't be final. + SettingsValues currentSettingsValues = mSettings.getCurrent(); if (editorInfo == null) { Log.e(TAG, "Null EditorInfo in onStartInputView()"); @@ -831,7 +808,7 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen accessUtils.onStartInputViewInternal(mainKeyboardView, editorInfo, restarting); } - final boolean inputTypeChanged = !mLastEditorChangeInfo.mIsSameInputType; + final boolean inputTypeChanged = !currentSettingsValues.isSameInputType(editorInfo); final boolean isDifferentTextField = !restarting || inputTypeChanged; if (isDifferentTextField) { mSubtypeSwitcher.updateParametersOnStartInputView(); @@ -876,12 +853,13 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen canReachInputConnection = true; } - if (isDifferentTextField || !mLastEditorChangeInfo.mHasSameOrientation) { + if (isDifferentTextField || + !currentSettingsValues.hasSameOrientation(getResources().getConfiguration())) { loadSettings(); } - final SettingsValues currentSettingsValues = mSettings.getCurrent(); if (isDifferentTextField) { mainKeyboardView.closing(); + currentSettingsValues = mSettings.getCurrent(); if (currentSettingsValues.mAutoCorrectionEnabledPerUserSettings) { suggest.setAutoCorrectionThreshold( |