Please sign in to comment.
Currently there is an internal hidden class named ControlledInputConnectionWrapper which works as a proxy in the application process to receive incoming binder calls from input method and dispatch those method calls again on an appropriate thread. Although this is a kind of implementation details, basically you can see the same design everywhere in the Android. Currently ControlledInputConnectionWrapper is initialized with view.getHandler(), where the view here is the View which was used to call View#onCreateInputConnection(). This is actually a reasonable behavior because we have generally assumed that there the only reasonable way to implement InputConnection is to extend BaseInputConnection, which is designed to be able to work only on the UI-thread associated with the target view. However, on Android N and onward, we are going to ensure that BaseInputConnection can be re-implemented on top of public APIs . Although most of applications should not try to do that, for certain applications such as web browsers and WebView it may make sense to let custom InputConnection implementation run with a custom Handler so that the application can respond to the IME without blocking the UI thread. To do that, this CL introduces a new method InputConnection#getHandler(), which changes nothing as long as it returns null, but if it returns non-null Handler, InputMethodManager will use it to initialize ControlledInputConnectionWrapper. Note that InputConnection#getHandler() is not for IME developers. It just returns null when called in the IME process.  See Bug 24688781 for details. Bug: 26945674 Change-Id: Id9e579bb3e2966986cdcb1c34bc8cacfeca2e1a9
- Loading branch information...
Showing with 48 additions and 3 deletions.
- +3 −0 api/current.txt
- +3 −0 api/system-current.txt
- +3 −0 api/test-current.txt
- +5 −0 core/java/android/view/inputmethod/BaseInputConnection.java
- +12 −0 core/java/android/view/inputmethod/InputConnection.java
- +5 −0 core/java/android/view/inputmethod/InputConnectionWrapper.java
- +5 −3 core/java/android/view/inputmethod/InputMethodManager.java
- +6 −0 core/java/android/widget/AbsListView.java
- +6 −0 core/java/com/android/internal/view/InputConnectionWrapper.java