This CL fixes a race condition for IMM#showSoftInput, which surfaces
when it's called during an IME hide animation.
IMM#showSoftInput ends up calling WIC#show asynchronously, but at that
time the running IME hide animation may have already been finished
successfully, and WIC#show may fail to cancel the hide animation
(then the cleanup IMM#notifyImeHidden hides the IME again disruptively).
I think a clean fix is to have IMM#showSoftInput call WIC#show
synchronously. However, this requires a significant refactoring.
As a short term fix, this CL adds a boolean field indicating whether or
not IMM#showSoftInput has been called. If it's called, we skip calling
IMM#notifyImeHidden.
Bug: 221483132
Bug: 225674038
Test: atest InputMethodStressTest
Test: atest CtsInputMethodTestCases
Test: atest WindowInsetsAnimationControllerTests
Change-Id: I36d570630085d0bc34097a2433208601dc9cb0fd
(cherry picked from commit 4c607982ed)
Merged-In: I36d570630085d0bc34097a2433208601dc9cb0fd
Currently, IMMS will be notified asynchronously when an IME hide
animation finishes, via message dispatching through IMS
(IMM#notifyImeHidden -> IMS#notifyImeHidden -> IMMS#hideMySoftInput).
This creates a race condition when IMM#showSoftInput or WIC#show is
called around the end of hide animation.
This CL fixes the race condition by synchronously and directly
calling IMMS#hideSoftInput from IMM#notifyImeHidden.
Note that there is still another race condition for IMM#showSoftInput
(not WIC#show) if it's called during an IME hide animation;
IMM#showSoftInput ended up calling WIC#show asynchronously, but at that
time the running IME hide animation may have already been finished
successfully and WIC#show may fail to cancel the hide animation
(then the cleanup IMM#notifyImeHidden hides the IME again disruptively).
I will fix the latter issue in a separate CL.
Bug: 221483132
Bug: 225674038
Test: atest InputMethodStressTest
Test: atest CtsInputMethodTestCases
Test: atest WindowInsetsAnimationControllerTests
Change-Id: I7c71dc5a1d6b61aa79d1666f0e257e6401e4adb2
(cherry picked from commit 9065310f81)
Merged-In: I7c71dc5a1d6b61aa79d1666f0e257e6401e4adb2
The label can be as-is ("Test reply") or all-caps ("TEST REPLY")
depending on the system config.
Bug: 227712564
Bug: 227424350
Test: atest InputMethodStressTest
Change-Id: Id64793f572bec06c84a235fc7688870f44013723
Due to b/221483132, IMM#showSoftInput() may not work
while IME is animating.
NUM_TEST_ITERATIONS is reduced to avoid test timeout.
Bug: 220385622
Test: atest InputMethodStressTest
Change-Id: If2a9d6e88b801faf491141f5f702b735a490a8db
The command should not have "adb shell", as the command is passed to
the device shell by RunCommandTargetPreparer.
Bug: 220385622
Test: atest InputMethodStressTest
Change-Id: I95a90d73e2c26c0ad21d5000b19ff8d805de5250
Some emulators have a physical keyboard and the test fails if the
default IME suppresses itself.
Set show_ime_with_hard_keyboard setting to request always showing
virtual keyboard.
Bug: 220385622
Test: atest InputMethodStressTest
Change-Id: Iaf0d30635ca94ae044bb3d3ed771387ce2288cb3
Autoshow is a feature of InputMethodManagerService.
This feature is not documented nor guarded by CTS.
A non-CTS regression test will be useful for keeping
UX consistency across Android versions.
Bug: 195468725
Test: atest InputMethodStressTest
Change-Id: I8025ff9b7813d0d5552f1ff84fff018bd0a178fa
This CL added a simple test of showing and hiding IME for 100 times.
TODOs:
1. Add more complicated flows (such as notification).
2. Check IME visibility in several points (WindowManager dump,
SurfaceFlinger dump, etc), not just the inset that the app received.
Bug: 195468725
Test: atest InputMethodStressTest
Change-Id: I1959225a7396d17750d799e11c42eb1899fe5bb9