Ensure that VirtualMouse creation is complete before usage
Use Thread.join for waiting for the virtual mouse creation to complete
before calling methods using the virtual mouse.
This approach blocks the calling thread only if the virtual mouse creation thread
is still running, and returns immediately if the thread has already completed.
This will also fix test flakiness, which were failing due to
VirtualMouse not being available yet.
Bug: 356262422
Test: atest FrameworksServicesTests:MouseKeysInterceptorTest --iterations 300
Flag: TEST_ONLY
Change-Id: I5bbbcad565dcfb5c8c71b1241828aaa005d185e0
2 files changed