aboutsummaryrefslogtreecommitdiffstats
path: root/java/src/com/android/inputmethod/deprecated
diff options
context:
space:
mode:
authorsatok <satok@google.com>2011-03-18 21:22:28 -0700
committersatok <satok@google.com>2011-03-23 01:12:27 -0700
commit10dd34de0ffcde0104f7d2dae3a3c9fd66abffcc (patch)
treeeaa8a5010f1febe95c7a85694b7e2bb509fc9ffd /java/src/com/android/inputmethod/deprecated
parent5862b4cb8aca86cdb057e2acff138bbf814d7016 (diff)
downloadlatinime-10dd34de0ffcde0104f7d2dae3a3c9fd66abffcc.tar.gz
latinime-10dd34de0ffcde0104f7d2dae3a3c9fd66abffcc.tar.xz
latinime-10dd34de0ffcde0104f7d2dae3a3c9fd66abffcc.zip
Add InputMethodServiceCompatWrapper for moving the callback from LatinIME.
Change-Id: If6b0180c63738e5e78a20fe5b938ef50d62865d6
Diffstat (limited to 'java/src/com/android/inputmethod/deprecated')
-rw-r--r--java/src/com/android/inputmethod/deprecated/VoiceConnector.java15
1 files changed, 13 insertions, 2 deletions
diff --git a/java/src/com/android/inputmethod/deprecated/VoiceConnector.java b/java/src/com/android/inputmethod/deprecated/VoiceConnector.java
index 5c78e9d24..a5c307c5b 100644
--- a/java/src/com/android/inputmethod/deprecated/VoiceConnector.java
+++ b/java/src/com/android/inputmethod/deprecated/VoiceConnector.java
@@ -566,14 +566,24 @@ public class VoiceConnector implements VoiceInput.UiListener {
@Override
protected void onPostExecute(Boolean result) {
+ // Calls in this method need to be done in the same thread as the thread which
+ // called switchToLastInputMethod()
if (!result) {
if (DEBUG) {
Log.d(TAG, "Couldn't switch back to last IME.");
}
- // Needs to reset here because LatinIME failed to back to any IME and
- // the same voice subtype will be triggered in the next time.
+ // Because the current IME and subtype failed to switch to any other IME and
+ // subtype by switchToLastInputMethod, the current IME and subtype should keep
+ // being LatinIME and voice subtype in the next time. And for re-showing voice
+ // mode, the state of voice input should be reset and the voice view should be
+ // hidden.
mVoiceInput.reset();
mService.requestHideSelf(0);
+ } else {
+ // Notify an event that the current subtype was changed. This event will be
+ // handled if "onCurrentInputMethodSubtypeChanged" can't be implemented
+ // when the API level is 10 or previous.
+ mService.notifyOnCurrentInputMethodSubtypeChanged(null);
}
}
}.execute();
@@ -630,6 +640,7 @@ public class VoiceConnector implements VoiceInput.UiListener {
}
private boolean shouldShowVoiceButton(FieldContext fieldContext, EditorInfo attribute) {
+ @SuppressWarnings("deprecation")
final boolean noMic = Utils.inPrivateImeOptions(null,
LatinIME.IME_OPTION_NO_MICROPHONE_COMPAT, attribute)
|| Utils.inPrivateImeOptions(mService.getPackageName(),