Accelerate shortcuts for input injection

There are certain shortcuts for key events that are treated specially in
InputDispatcher. Currently, the processing occurs exclusively in
notifyKey, which means injected events do not go through that path. As a
result, the shortcut behaviour cannot be tested with CTS tests easily.

Refactor the shortcut-handling code into a separate function here, then
call this function from injectInputEvent as well as in notifyKey in
InputDispatcher.cpp.

Test: atest KeyEventInterceptTest
Bug: 77548740
Change-Id: Ic31ecc56affd612f144143c83978364b3be9e252
3 files changed