diff options
author | 2013-12-27 17:04:12 +0900 | |
---|---|---|
committer | 2014-01-23 13:09:58 +0900 | |
commit | ab80b41a0dee298837b1358457768ee5ac0fc79e (patch) | |
tree | a2a43d6370f08fc785750af0b524486bda4869de /java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java | |
parent | a91dfff5e54f68c4003327eeca47286084c35a2f (diff) | |
download | latinime-ab80b41a0dee298837b1358457768ee5ac0fc79e.tar.gz latinime-ab80b41a0dee298837b1358457768ee5ac0fc79e.tar.xz latinime-ab80b41a0dee298837b1358457768ee5ac0fc79e.zip |
[IL66] Remove two accesses to KeyboardSwitcher.
Bug: 8636060
Change-Id: I3b144993e2bcd552f9b292b8f057c9db4216125c
Diffstat (limited to 'java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java')
-rw-r--r-- | java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java b/java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java index 20be81411..3c5406545 100644 --- a/java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java +++ b/java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java @@ -300,7 +300,6 @@ public final class InputLogic { code, x, y, spaceState, keyboardSwitcher, handler); break; } - keyboardSwitcher.onCodeInput(code); // Reset after any single keystroke, except shift, capslock, and symbol-shift if (!didAutoCorrect && code != Constants.CODE_SHIFT && code != Constants.CODE_CAPSLOCK @@ -1699,26 +1698,27 @@ public final class InputLogic { * @param settingsValues the current values of the settings. * @param tryResumeSuggestions Whether we should resume suggestions or not. * @param remainingTries How many times we may try again before giving up. + * @return whether true if the caches were successfully reset, false otherwise. */ // TODO: make this private - public void retryResetCaches(final SettingsValues settingsValues, + public boolean retryResetCachesAndReturnSuccess(final SettingsValues settingsValues, final boolean tryResumeSuggestions, final int remainingTries, // TODO: remove these arguments - final KeyboardSwitcher keyboardSwitcher, final LatinIME.UIHandler handler) { + final LatinIME.UIHandler handler) { if (!mConnection.resetCachesUponCursorMoveAndReturnSuccess( mConnection.getExpectedSelectionStart(), mConnection.getExpectedSelectionEnd(), false)) { if (0 < remainingTries) { handler.postResetCaches(tryResumeSuggestions, remainingTries - 1); - return; + return false; } - // If remainingTries is 0, we should stop waiting for new tries, but it's still - // better to load the keyboard (less things will be broken). + // If remainingTries is 0, we should stop waiting for new tries, however we'll still + // return true as we need to perform other tasks (for example, loading the keyboard). } mConnection.tryFixLyingCursorPosition(); - keyboardSwitcher.loadKeyboard(getCurrentInputEditorInfo(), settingsValues); if (tryResumeSuggestions) { handler.postResumeSuggestions(); } + return true; } } |