Fix unexpected IME visible by editor be refocused during the test

KeyboardVisiblityControlTest#runImeDoesntReshowAfterKeyguardTest
made by CL[1] tests the keyboard will end up invisible after clearing
editor focus with View#clearFocus & unlocked the screen.

Somehow the test might be flaky by unexpected IME visible after
the screen unlocked. The reason is because in the javadoc of
View#clearFocus states:

 * Note: When not in touch-mode, the framework will try to give focus
 *  to the first focusable View from the top after focus is cleared.

As the result, if the test requires to call clearFocus intentionally
without unexpected reFocus behavior, we have to ensure the UI is always
in touch mode during the test.

To fix that, add enterTouchMode with @Before annotation in
EndToEndImeTestBase to ensure all IME end-to-end test will set in touch
mode with invoking Intrsumentation#setInTouchMode before the test.

[1]: I2b1193f541933380fc97d83aee2da1e9d5f0faa9

Fix: 220180252
Bug: 220907843
Test: atest KeyboardVisibilityControlTest --rerun-until-failure 50
Change-Id: I91d2abe3ace37f7d703488577ee396550307ee08
1 file changed