diff options
| author | satok <satok@google.com> | 2010-11-11 20:40:09 +0900 |
|---|---|---|
| committer | satok <satok@google.com> | 2010-11-13 08:00:25 +0900 |
| commit | 735cf38b8c7f8f91ad087511e44fe79018fa61d6 (patch) | |
| tree | d667e138277bad675890391fe741e1e7433049ee /services/java | |
| parent | 46e75294d540fe807d78aec2582ae02cc38c7d42 (diff) | |
| download | frameworks_base-735cf38b8c7f8f91ad087511e44fe79018fa61d6.zip frameworks_base-735cf38b8c7f8f91ad087511e44fe79018fa61d6.tar.gz frameworks_base-735cf38b8c7f8f91ad087511e44fe79018fa61d6.tar.bz2 | |
Add a function to switch back to the last used IME
Change-Id: Iac7bcc2ee16dd04d91a3e75b160622d246788c9a
Diffstat (limited to 'services/java')
| -rw-r--r-- | services/java/com/android/server/InputMethodManagerService.java | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/services/java/com/android/server/InputMethodManagerService.java b/services/java/com/android/server/InputMethodManagerService.java index 0d3cfde..1df4405 100644 --- a/services/java/com/android/server/InputMethodManagerService.java +++ b/services/java/com/android/server/InputMethodManagerService.java @@ -1279,6 +1279,21 @@ public class InputMethodManagerService extends IInputMethodManager.Stub setInputMethodWithSubtype(token, id, NOT_A_SUBTYPE_ID); } + public boolean switchToLastInputMethod(IBinder token) { + synchronized (mMethodMap) { + Pair<String, String> lastIme = mSettings.getLastInputMethodAndSubtypeLocked(); + if (lastIme != null) { + InputMethodInfo imi = mMethodMap.get(lastIme.first); + if (imi != null) { + setInputMethodWithSubtype(token, lastIme.first, getSubtypeIdFromHashCode( + imi, Integer.valueOf(lastIme.second))); + return true; + } + } + return false; + } + } + private void setInputMethodWithSubtype(IBinder token, String id, int subtypeId) { synchronized (mMethodMap) { if (token == null) { |
