Add an end-to-end CTS test for per-profile IME
This CL introduces an end-to-end test that ensures the personal
profile apps talk to personal profile IMEs and work profile apps talk
to work profile IMEs, even if the focused application is switched from
personal profile's one to work profile's one and vice versa.
The core idea is updating our test IME (CtsBaseInputMethod) to send
back the result of Process.myUserHandle() to the test app with
InputConnection#performPrivateCommand() when a certain key is
specified in EditorInfo#extras. The test app can verify that the
UserHandle object sent from the IME is equal to its own result of
Process.myUserHandle(). If those two instances are equal, then we can
confirm that the app and the IME are running as the same user.
Fix: 120784635
Test: atest CtsInputMethodServiceHostTestCases
Change-Id: Iebc92a31e5bfe8f506c519d9f9427b4d57048b81
8 files changed