aboutsummaryrefslogtreecommitdiffstats
path: root/java/src/com/android/inputmethod/latin
diff options
context:
space:
mode:
authorSatoshi Kataoka <satok@google.com>2011-01-24 13:31:19 -0800
committerAndroid Git Automerger <android-git-automerger@android.com>2011-01-24 13:31:19 -0800
commit85f57c04a652c1125de0f29d937a948e67f80e24 (patch)
tree0022413b9afb65f2b23c1ace98ef31836a0ffbdf /java/src/com/android/inputmethod/latin
parent8c1ff8c23fe394ecb8feb1f1659cfe8a7f9ed26e (diff)
parent6f294c3de4e86b452ebde0259cb462d02503339a (diff)
downloadlatinime-85f57c04a652c1125de0f29d937a948e67f80e24.tar.gz
latinime-85f57c04a652c1125de0f29d937a948e67f80e24.tar.xz
latinime-85f57c04a652c1125de0f29d937a948e67f80e24.zip
am 6f294c3d: am 17bc97c1: Merge "Fix resetting the status of VoiceIME when the user is switching from one VoiceIME to another Voice IME" into honeycomb
* commit '6f294c3de4e86b452ebde0259cb462d02503339a': Fix resetting the status of VoiceIME when the user is switching from one VoiceIME to another Voice IME
Diffstat (limited to 'java/src/com/android/inputmethod/latin')
-rw-r--r--java/src/com/android/inputmethod/latin/SubtypeSwitcher.java17
1 files changed, 13 insertions, 4 deletions
diff --git a/java/src/com/android/inputmethod/latin/SubtypeSwitcher.java b/java/src/com/android/inputmethod/latin/SubtypeSwitcher.java
index 01e09fbc0..7a1ac2e27 100644
--- a/java/src/com/android/inputmethod/latin/SubtypeSwitcher.java
+++ b/java/src/com/android/inputmethod/latin/SubtypeSwitcher.java
@@ -223,6 +223,9 @@ public class SubtypeSwitcher {
}
mMode = newMode;
}
+
+ // If the old mode is voice input, we need to reset or cancel its status.
+ // We cancel its status when we change mode, while we reset otherwise.
if (isKeyboardMode()) {
if (modeChanged) {
if (VOICE_MODE.equals(oldMode) && mVoiceInput != null) {
@@ -233,17 +236,23 @@ public class SubtypeSwitcher {
updateShortcutIME();
mService.onRefreshKeyboard();
}
- } else if (isVoiceMode()) {
+ } else if (isVoiceMode() && mVoiceInput != null) {
+ if (VOICE_MODE.equals(oldMode)) {
+ mVoiceInput.reset();
+ }
// If needsToShowWarningDialog is true, voice input need to show warning before
// show recognition view.
if (languageChanged || modeChanged
|| VoiceIMEConnector.getInstance().needsToShowWarningDialog()) {
- if (mVoiceInput != null) {
- triggerVoiceIME();
- }
+ triggerVoiceIME();
}
} else {
Log.w(TAG, "Unknown subtype mode: " + mMode);
+ if (VOICE_MODE.equals(oldMode) && mVoiceInput != null) {
+ // We need to reset the voice input to release the resources and to reset its status
+ // as it is not the current input mode.
+ mVoiceInput.reset();
+ }
}
}