diff options
author | 2011-01-25 20:55:23 +0900 | |
---|---|---|
committer | 2011-01-25 23:01:13 +0900 | |
commit | 760884e027c4c678e6baed9a9857bd3c351abefb (patch) | |
tree | 8263a3bd7bf40dd510a2733943dd9613176e57f3 /java/src | |
parent | 099b4dc6ec4cf727e88ebea2a3d88b1ecc0ae55a (diff) | |
download | latinime-760884e027c4c678e6baed9a9857bd3c351abefb.tar.gz latinime-760884e027c4c678e6baed9a9857bd3c351abefb.tar.xz latinime-760884e027c4c678e6baed9a9857bd3c351abefb.zip |
Hide recognition view when switchToLastInputMethod failed.
Change-Id: Ie5f3d267e1042b4379b51c2dc6c8756e394cfc0f
Diffstat (limited to 'java/src')
-rw-r--r-- | java/src/com/android/inputmethod/voice/VoiceIMEConnector.java | 14 |
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) { |