diff options
| author | Tarandeep Singh <tarandeep@google.com> | 2018-02-28 14:17:43 -0800 |
|---|---|---|
| committer | Tarandeep Singh <tarandeep@google.com> | 2018-03-06 02:23:15 +0000 |
| commit | 164cfba536644095b962b45379020a792d3c51c8 (patch) | |
| tree | 5099811758fa8c1547ad3a0fc3ac3d50b3b3d8b4 /core/java/android/inputmethodservice/InputMethodService.java | |
| parent | 2cb0244ade0daf166882c6d4ca147e1f92862af2 (diff) | |
IME API: rename IMS methods.
Incorporating API Review feedback:
* Use IMS.switchInputMethod(id) instead of IMS.setInputMethod()
* Use IMS.switchInputMethod(id, subtypeId) instead of
IMS.setInputMethodAndSubtype()
* Renamed switchToLastInputMethod() to switchToPreviousInputMethod()
Bug: 73954137
Test: atest InputMethodServiceTest
Test: atest CtsInputMethodServiceHostTestCases
Change-Id: I6efd5ca473e33e6faeadb7eea7772b9d2b8ca12b
Diffstat (limited to 'core/java/android/inputmethodservice/InputMethodService.java')
| -rw-r--r-- | core/java/android/inputmethodservice/InputMethodService.java | 37 |
1 files changed, 15 insertions, 22 deletions
diff --git a/core/java/android/inputmethodservice/InputMethodService.java b/core/java/android/inputmethodservice/InputMethodService.java index 017674f5ea8a..f38c37a2fb70 100644 --- a/core/java/android/inputmethodservice/InputMethodService.java +++ b/core/java/android/inputmethodservice/InputMethodService.java @@ -1075,33 +1075,14 @@ public class InputMethodService extends AbstractInputMethodService { } /** - * 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 id The unique identifier for the new input method to be switched to. - */ - public void setInputMethod(String id) { - mImm.setInputMethodInternal(mToken, id); - } - - /** - * 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 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(String id, InputMethodSubtype subtype) { - mImm.setInputMethodAndSubtypeInternal(mToken, id, subtype); - } - - /** * Force switch to the last used input method and subtype. If the last input method didn't have * any subtypes, the framework will simply switch to the last input method with no subtype * specified. * @return true if the current input method and subtype was successfully switched to the last * used input method and subtype. */ - public boolean switchToLastInputMethod() { - return mImm.switchToLastInputMethodInternal(mToken); + public boolean switchToPreviousInputMethod() { + return mImm.switchToPreviousInputMethodInternal(mToken); } /** @@ -1455,12 +1436,24 @@ public class InputMethodService extends AbstractInputMethodService { * input method will be destroyed, and the requested one started on the * current input field. * - * @param id Unique identifier of the new input method ot start. + * @param id Unique identifier of the new input method to start. */ public void switchInputMethod(String id) { mImm.setInputMethodInternal(mToken, id); } + /** + * Force switch to a new input method, as identified by {@code id}. This + * input method will be destroyed, and the requested one started on the + * current input field. + * + * @param id Unique identifier of the new input method to start. + * @param subtype The new subtype of the new input method to be switched to. + */ + public void switchInputMethod(String id, InputMethodSubtype subtype) { + mImm.setInputMethodAndSubtypeInternal(mToken, id, subtype); + } + public void setExtractView(View view) { mExtractFrame.removeAllViews(); mExtractFrame.addView(view, new FrameLayout.LayoutParams( |
