Fix failed testSwitchToInputMethod() on AAOS

The test failed on AAOS because the testing IME was not enabled
when switchToInputMethod() was called.

To fix it, the CL enabled the testing IME properly and waited until
enabled. To make sure the test can pass when running repeatedly, the
CL also reset the IME properly when the test finished.

Fixes: 362195125
Fixes: 358334508
Test: atest CtsAccessibilityServiceTestCases
Test: atest android.accessibilityservice.cts.AccessibilitySoftKeyboardTest#testSwitchToInputMethod --iterations 10
Flag: TEST_ONLY
Change-Id: I3e12617eb0ed7a634efa3139ab3ebc25808c0edb
1 file changed