summaryrefslogtreecommitdiff
path: root/core/java/android/inputmethodservice/InputMethodServiceInternal.java
Commit message (Collapse)AuthorAgeFilesLines
* Let A11yIME use its own IPC definitionsYohei Yukawa2022-04-181-4/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a follow up CL to our previuos CL [1], which enabled AccessibilityService to use a subset of InputConnection APIs. In that CL we have reused existing AIDL interfaces that were designed and maintained for IMEs for simplicity, where a non trivial amount of unnecessary IPC endpoints were included. From the security and maintainability viewpoints, however, exposing unnecessary IPC endpoints is discouraged in general. To address such concerns this CL introduces a set of dedicated IPC definitions for A11yIME so that we do not need to reuse IPCs for IMEs. This CL also stops passing InputBinding object to A11yIME process as it contains IInputContext Binder Proxy, which can still be used to directly invoke fallback InputConnection. This is doable now because A11yIME no longer relies on fallback InputConnection [2]. This CL is should not have any observable changes in the semantics. End-to-end CTS tests guarantee that everything is still working as intended now and in the future. [1]: Ia651a811093a939d00c081be1961e24ed3ad0356 fb17e5ae7a9e1a095d114d8dde76f14578b6c233 [2]: I2af3cd50444d8ddf25aa0f6479238156914e6fff dc635efb687ac04045f2756b02c5ca2435762956 Fix: 215633021 Fix: 215636776 Test: atest CtsInputMethodTestCases:AccessibilityInputMethodTest Test: atest CtsAccessibilityServiceTestCases:AccessibilityInputConnectionTest Test: atest CtsAccessibilityServiceTestCases:AccessibilityImeTest Change-Id: I5ff2e804cbcf90828370a0612ff54111130bdff4
* Allow a11y services to enter text via the path IMEs useyingleiw2022-02-081-3/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | InputMethodService is the primary and a11y is the secondary. InputMethodService is not affected by a11y status. When the session from input method is established, app can start input (pass input context to input method). When an a11y session comes back, it will be passed to the app. When InputMethodManagerService binds to/start input with InputMethodService, it does the same to a11y services which requested IME functionalities. It is possible that input method can edit text before ally sessios are established. So the EditorInfo passed to a11y could be stale. So when an a11y session is passed to client, client will send a notification (input method doesn't have this extra notification) for the current selection. I think since the time for a11y session establish shouldn't be long, and we get the current state later, it should be fine for a11y services. When input method is disconnected from app (client) (even for input method switching), we cleared a11y and sessions too. When input method request sessions, we must rerequest sessions for a11y. This is mainly because when we unbindCurrentClientLocked(SWITCH_IME), we set active to false for the current client. Suppose we don't want to change the current structure of input method, an inactive client probably should clear accessibility sessions too. When we switch to a client which already has a session with input method, there might be some a11y sessions with this client, and some a11y services might be disabled or enabled while the client was switched out. We pass unchanged a11y sessions to client, and request sessions for newly enabled a11y services. When an a11y service is disabled, it removes its session from all clients in InputMethodManagerService. Test: type word through modified "switchToInputMethod". Tested session notification through logs. Tested client switching, input method switching, a11y service enabled/disable, multiple a11y services, a11y service enabled before device reboot. Also tested work profile. Bug: 187453053 Change-Id: Ia651a811093a939d00c081be1961e24ed3ad0356
* Introduce InputMethodServiceInternal for better abstractionYohei Yukawa2021-07-131-0/+86
This is a mechanical refactoring CL that has no behavior change. This CL removes the direct dependency on AbstractInputMethodService from whenever possible. As a result, the following classes no longer directly depend on AbstractInputMethodService. * android.inputmethodservice.IInputMethodWrapper * android.inputmethodservice.RemoteInputConnection * com.android.internal.inputmethod.ImeTracing * com.android.internal.inputmethod.ImeTracingClientImpl * com.android.internal.inputmethod.ImeTracingServerImpl This is still a purely mechanical refactoring. There should be no observable behavior change. Bug: 192412909 Test: atest CtsInputMethodTestCases Test: Manually verified that IME tracing still works Change-Id: I2aeeeacd27195ce10059d6590e098a4a969e774d