From beb08b398fa73a26f2d42d6feec87e34a96ca2d9 Mon Sep 17 00:00:00 2001 From: "Tadashi G. Takaoka" Date: Thu, 16 Feb 2012 11:45:35 -0800 Subject: Remove unnecessary and harmful KeyboardState.onUpdateShiftState call This change also cancels double tap and long press timers if other letter key is pressed after shift key. Bug: 5693999 Bug: 6017610 Change-Id: I3b5f3debfb8915fa73a93b409a38afadf24132e9 --- java/src/com/android/inputmethod/latin/LatinIME.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'java/src/com/android/inputmethod/latin/LatinIME.java') diff --git a/java/src/com/android/inputmethod/latin/LatinIME.java b/java/src/com/android/inputmethod/latin/LatinIME.java index 1cb79e707..730992b13 100644 --- a/java/src/com/android/inputmethod/latin/LatinIME.java +++ b/java/src/com/android/inputmethod/latin/LatinIME.java @@ -325,7 +325,7 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar return hasMessages(MSG_UPDATE_SUGGESTIONS); } - public void postUpdateShiftKeyState() { + public void postUpdateShiftState() { removeMessages(MSG_UPDATE_SHIFT_STATE); sendMessageDelayed(obtainMessage(MSG_UPDATE_SHIFT_STATE), mDelayUpdateShiftState); } @@ -898,9 +898,10 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar resetComposingState(true /* alsoResetLastComposedWord */); updateSuggestions(); } + + mHandler.postUpdateShiftState(); } mExpectingUpdateSelection = false; - mHandler.postUpdateShiftKeyState(); // TODO: Decide to call restartSuggestionsOnWordBeforeCursorIfAtEndOfWord() or not // here. It would probably be too expensive to call directly here but we may want to post a // message to delay it. The point would be to unify behavior between backspace to the @@ -1391,7 +1392,7 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar mVoiceProxy.handleBackspace(); // In many cases, we may have to put the keyboard in auto-shift state again. - mHandler.postUpdateShiftKeyState(); + mHandler.postUpdateShiftState(); if (mEnteredText != null && sameAsTextBeforeCursor(ic, mEnteredText)) { // Cancel multi-character input: remove the text we just entered. -- cgit v1.2.3-83-g751a