aboutsummaryrefslogtreecommitdiffstats
path: root/java/src
diff options
context:
space:
mode:
authorTadashi G. Takaoka <takaoka@google.com>2011-09-27 19:32:40 -0700
committerAndroid Git Automerger <android-git-automerger@android.com>2011-09-27 19:32:40 -0700
commit34e56f1a2e58d8a73f27c85fcd95aab74e058077 (patch)
tree7a36c4462843b4ea4c6e4698d5e856f3ef9e9cdd /java/src
parent8a89850dffc44343d5acdec13958130b388422ff (diff)
parentffd156c77e93a54b704780b46886ba597d1c77cb (diff)
downloadlatinime-34e56f1a2e58d8a73f27c85fcd95aab74e058077.tar.gz
latinime-34e56f1a2e58d8a73f27c85fcd95aab74e058077.tar.xz
latinime-34e56f1a2e58d8a73f27c85fcd95aab74e058077.zip
am ffd156c7: Postpone onDisplayCompletions until onStartInputView has been executed
* commit 'ffd156c77e93a54b704780b46886ba597d1c77cb': Postpone onDisplayCompletions until onStartInputView has been executed
Diffstat (limited to 'java/src')
-rw-r--r--java/src/com/android/inputmethod/latin/LatinIME.java21
1 files changed, 20 insertions, 1 deletions
diff --git a/java/src/com/android/inputmethod/latin/LatinIME.java b/java/src/com/android/inputmethod/latin/LatinIME.java
index ddda184aa..32649d5a1 100644
--- a/java/src/com/android/inputmethod/latin/LatinIME.java
+++ b/java/src/com/android/inputmethod/latin/LatinIME.java
@@ -241,7 +241,8 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar
private static final int MSG_SET_BIGRAM_PREDICTIONS = 7;
private static final int MSG_START_ORIENTATION_CHANGE = 8;
private static final int MSG_START_INPUT_VIEW = 9;
- private static final int MSG_RESTORE_KEYBOARD_LAYOUT = 10;
+ private static final int MSG_DISPLAY_COMPLETIONS = 10;
+ private static final int MSG_RESTORE_KEYBOARD_LAYOUT = 11;
public UIHandler(LatinIME outerInstance) {
super(outerInstance);
@@ -293,6 +294,9 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar
case MSG_START_INPUT_VIEW:
latinIme.onStartInputView((EditorInfo)msg.obj, false);
break;
+ case MSG_DISPLAY_COMPLETIONS:
+ latinIme.onDisplayCompletions((CompletionInfo[])msg.obj);
+ break;
case MSG_RESTORE_KEYBOARD_LAYOUT:
removeMessages(MSG_UPDATE_SHIFT_STATE);
((KeyboardLayoutState)msg.obj).restore();
@@ -417,6 +421,18 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar
}
return false;
}
+
+ public boolean postDisplayCompletions(CompletionInfo[] applicationSpecifiedCompletions) {
+ if (hasMessages(MSG_START_INPUT_VIEW) || hasMessages(MSG_DISPLAY_COMPLETIONS)) {
+ removeMessages(MSG_DISPLAY_COMPLETIONS);
+ // Postpone onDisplayCompletions by ACCUMULATE_START_INPUT_VIEW_DELAY.
+ sendMessageDelayed(
+ obtainMessage(MSG_DISPLAY_COMPLETIONS, applicationSpecifiedCompletions),
+ ACCUMULATE_START_INPUT_VIEW_DELAY);
+ return true;
+ }
+ return false;
+ }
}
@Override
@@ -923,6 +939,9 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar
@Override
public void onDisplayCompletions(CompletionInfo[] applicationSpecifiedCompletions) {
+ if (mHandler.postDisplayCompletions(applicationSpecifiedCompletions)) {
+ return;
+ }
if (DEBUG) {
Log.i(TAG, "Received completions:");
if (applicationSpecifiedCompletions != null) {