From 51b921d0e33302b3f431dcfa15bd6588408525ea Mon Sep 17 00:00:00 2001 From: Yohei Yukawa Date: Wed, 5 Mar 2014 14:53:01 +0900 Subject: DO NOT MERGE - Preserve the order of InputMethodManager method calls Cherrypick of I0f8d33b0c77129f72581bc43e7f4fdc25469b520 This CL allows the Framework class InputMethodManager to behave in a more deterministic way, that is to say, with an I/O barrier. InputMethodManager#setAdditionalInputMethodSubtypes is internally implemented as a RPC to the corresponding counterpart in InputMethodManagerService. The problem here is that this RPC is marked as "oneway". As a consequence, this public API call returns immediately without waiting the additional subtypes are actually added. This behavior is also not documented so far unfortunately. See the following demo code: Final InputMethodManager imm = ...; imm.setAdditionalInputMethodSubtypes(id, subTypes); Final List ims = imm.getInputMethodList(); Currently, it is not guaranteed that the InputMethodInfo returned from #getInputMethodList reflects the result of the previous call of #setAdditionalInputMethodSubtypes because of its undocumented asynchronous nature. With this CL, InputMethodManager#setAdditionalInputMethodSubtypes behaves as if it has I/O barrier. This change should make it easy for IME developers to use additional subtype mechanism. BUG: 13033954 BUG: 13291370 Change-Id: I0455b176bfb3176c533ba3241881f05092b98abc --- core/java/com/android/internal/view/IInputMethodManager.aidl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/java/com/android/internal/view/IInputMethodManager.aidl b/core/java/com/android/internal/view/IInputMethodManager.aidl index 12ced68..3724a08 100644 --- a/core/java/com/android/internal/view/IInputMethodManager.aidl +++ b/core/java/com/android/internal/view/IInputMethodManager.aidl @@ -73,5 +73,5 @@ interface IInputMethodManager { boolean switchToNextInputMethod(in IBinder token, boolean onlyCurrentIme); boolean shouldOfferSwitchingToNextInputMethod(in IBinder token); boolean setInputMethodEnabled(String id, boolean enabled); - oneway void setAdditionalInputMethodSubtypes(String id, in InputMethodSubtype[] subtypes); + void setAdditionalInputMethodSubtypes(String id, in InputMethodSubtype[] subtypes); } -- cgit v1.1