diff options
author | satok <satok@google.com> | 2010-11-24 11:06:49 +0900 |
---|---|---|
committer | satok <satok@google.com> | 2010-11-24 12:28:45 +0900 |
commit | 2820351489537698ad153c6397edf3270455edc5 (patch) | |
tree | ac5bcee60b4ddde371d7b4d0c75881821522d04d /core/java | |
parent | 07cb89432cf1687ba4f903f56bc1d92979d2cd4a (diff) | |
download | frameworks_base-2820351489537698ad153c6397edf3270455edc5.zip frameworks_base-2820351489537698ad153c6397edf3270455edc5.tar.gz frameworks_base-2820351489537698ad153c6397edf3270455edc5.tar.bz2 |
Add an API to set InputMethodAndSubtype
Change-Id: I66f1a4c8e0d98705614f12a737e7efcd0263b72a
Diffstat (limited to 'core/java')
-rw-r--r-- | core/java/android/view/inputmethod/InputMethodManager.java | 25 | ||||
-rw-r--r-- | core/java/com/android/internal/view/IInputMethodManager.aidl | 1 |
2 files changed, 22 insertions, 4 deletions
diff --git a/core/java/android/view/inputmethod/InputMethodManager.java b/core/java/android/view/inputmethod/InputMethodManager.java index 621a908..9bc1c22 100644 --- a/core/java/android/view/inputmethod/InputMethodManager.java +++ b/core/java/android/view/inputmethod/InputMethodManager.java @@ -1278,10 +1278,10 @@ public final class InputMethodManager { } } } - + /** - * Force switch to a new input method component. This can only be called - * from the currently active input method, as validated by the given token. + * Force switch to a new input method component. This can only be called + * from an application or a service which has a token of the currently active input method. * @param token Supplies the identifying token given to an input method * when it was started, which allows it to perform this operation on * itself. @@ -1294,7 +1294,24 @@ public final class InputMethodManager { throw new RuntimeException(e); } } - + + /** + * Force switch to a new input method and subtype. This can only be called + * from an application or a service which has a token of the currently active input method. + * @param token Supplies the identifying token given to an input method + * when it was started, which allows it to perform this operation on + * itself. + * @param id The unique identifier for the new input method to be switched to. + * @param subtype The new subtype of the new input method to be switched to. + */ + public void setInputMethodAndSubtype(IBinder token, String id, InputMethodSubtype subtype) { + try { + mService.setInputMethodAndSubtype(token, id, subtype); + } catch (RemoteException e) { + throw new RuntimeException(e); + } + } + /** * Close/hide the input method's soft input area, so the user no longer * sees it or can interact with it. This can only be called diff --git a/core/java/com/android/internal/view/IInputMethodManager.aidl b/core/java/com/android/internal/view/IInputMethodManager.aidl index 125b210..a2e9486 100644 --- a/core/java/com/android/internal/view/IInputMethodManager.aidl +++ b/core/java/com/android/internal/view/IInputMethodManager.aidl @@ -55,6 +55,7 @@ interface IInputMethodManager { void showInputMethodSubtypePickerFromClient(in IInputMethodClient client); void showInputMethodAndSubtypeEnablerFromClient(in IInputMethodClient client, String topId); void setInputMethod(in IBinder token, String id); + void setInputMethodAndSubtype(in IBinder token, String id, in InputMethodSubtype subtype); void hideMySoftInput(in IBinder token, int flags); void showMySoftInput(in IBinder token, int flags); void updateStatusIcon(in IBinder token, String packageName, int iconId); |