[ ] In the past it was done with broadcast receivers but link to change in API that caused us to remove it.
[ ] Show how the key mapper keyboard talks to different build types of Key Mapper.
[ ] Explain how it is used for receiving key events when the device is in a phone call so we need two-way communication between the app and keyboard.
[ ] Motivation: There may be more broadcast receiver restrictions in the future so just going as low-level as possible and using Binder is the most future proof. It also has less overhead. This is quite a complicated system because it must be two-way. The alternative using manifest-defined broadcast receivers is also inelegant because one has to pass messages between these broadcast receivers and the services through some 3rd class. Using Binder is also lower latency than using intents. Using a bound service is synchronous whereas broadcast receivers are asynchronous.
[ ] Put diagram in docs website.
[ ] Code for input methods to talk to the Key Event relay service can be found in KeyEventRelayServiceWrapper. It is called a relay service because this service sends key events bi-directionally between the accessibility service and input method services.
Key event communication architecture