aboutsummaryrefslogtreecommitdiffstats
path: root/java/src
diff options
context:
space:
mode:
authorsatok <satok@google.com>2011-01-25 19:25:41 -0800
committerAndroid Git Automerger <android-git-automerger@android.com>2011-01-25 19:25:41 -0800
commitd6ce8d98427f221ccb4379b7c96e649fdf419acc (patch)
tree25deef993424ba6cdd3e068da2d3b491ad2d1b78 /java/src
parent71aafa9445c3b830b9cbe56911a91b57d25e20e3 (diff)
parent257b2a58d1816ac44276322a1ba7fe67ddca49b8 (diff)
downloadlatinime-d6ce8d98427f221ccb4379b7c96e649fdf419acc.tar.gz
latinime-d6ce8d98427f221ccb4379b7c96e649fdf419acc.tar.xz
latinime-d6ce8d98427f221ccb4379b7c96e649fdf419acc.zip
am 257b2a58: Merge "Hide recognition view when switchToLastInputMethod failed." into honeycomb
* commit '257b2a58d1816ac44276322a1ba7fe67ddca49b8': Hide recognition view when switchToLastInputMethod failed.
Diffstat (limited to 'java/src')
-rw-r--r--java/src/com/android/inputmethod/voice/VoiceIMEConnector.java14
1 files changed, 12 insertions, 2 deletions
diff --git a/java/src/com/android/inputmethod/voice/VoiceIMEConnector.java b/java/src/com/android/inputmethod/voice/VoiceIMEConnector.java
index a3a3ea88e..a30570aa2 100644
--- a/java/src/com/android/inputmethod/voice/VoiceIMEConnector.java
+++ b/java/src/com/android/inputmethod/voice/VoiceIMEConnector.java
@@ -564,8 +564,18 @@ public class VoiceIMEConnector implements VoiceInput.UiListener {
}
private void switchToLastInputMethod() {
- IBinder token = mService.getWindow().getWindow().getAttributes().token;
- mImm.switchToLastInputMethod(token);
+ final IBinder token = mService.getWindow().getWindow().getAttributes().token;
+ new Thread ("switchToLastInputMethod") {
+ @Override
+ public void run() {
+ if (!mImm.switchToLastInputMethod(token)) {
+ // Needs to reset here because LatinIME failed to back to any IME and
+ // the same voice subtype will be triggered in the next time.
+ mVoiceInput.reset();
+ mService.requestHideSelf(0);
+ }
+ }
+ }.start();
}
private void reallyStartListening(boolean swipe) {