Bug 827176 - Properly reset GeckoInputConnection states during focus; r=cpeterson

This commit is contained in:
Jim Chen 2013-01-11 15:36:22 -05:00
parent c9a7f04a76
commit 3d4c428cab

View File

@ -40,10 +40,10 @@ class GeckoInputConnection
private static final int INLINE_IME_MIN_DISPLAY_SIZE = 480; private static final int INLINE_IME_MIN_DISPLAY_SIZE = 480;
private static int mIMEState; private int mIMEState;
private static String mIMETypeHint = ""; private String mIMETypeHint = "";
private static String mIMEModeHint = ""; private String mIMEModeHint = "";
private static String mIMEActionHint = ""; private String mIMEActionHint = "";
private String mCurrentInputMethod; private String mCurrentInputMethod;
@ -231,6 +231,20 @@ class GeckoInputConnection
imm.restartInput(v); imm.restartInput(v);
} }
private void resetInputConnection() {
if (mBatchEditCount != 0) {
Log.w(LOGTAG, "resetting with mBatchEditCount = " + mBatchEditCount);
mBatchEditCount = 0;
}
mBatchSelectionChanged = false;
mBatchTextChanged = false;
mUpdateRequest = null;
mIMEState = IME_STATE_DISABLED;
mIMETypeHint = mIMEModeHint = mIMEActionHint = "";
mCurrentInputMethod = "";
}
public void onTextChange(String text, int start, int oldEnd, int newEnd) { public void onTextChange(String text, int start, int oldEnd, int newEnd) {
if (mUpdateRequest == null) { if (mUpdateRequest == null) {
@ -506,8 +520,7 @@ class GeckoInputConnection
case NOTIFY_IME_FOCUSCHANGE: case NOTIFY_IME_FOCUSCHANGE:
// Showing/hiding vkb is done in notifyIMEEnabled // Showing/hiding vkb is done in notifyIMEEnabled
mBatchEditCount = 0; resetInputConnection();
mUpdateRequest = null;
break; break;
default: default: