Injecting text simultaneously to multiple displays
I am looking at a way to inject text simultaneously to two (or more) displays: an application on the main display, and a different application on a virtual display.
I have experimented with using InputManager.injectInput on the virtual display, but when I the I inject the text, I am not able to type anything on the main display. Similarly when I tried attaching a physical keyboard (emulated virtually), the text gets injected to where the focus is present.
Any suggestions on how to solve this problem? I am quite sure this is solved in Android Auto and was wondering if there are any pointers in Android Auto code that I can refer to?