Request focus using setFocusedWindow

Switch from using setInputWindow to setFocusedWindow to set the focused
window for a display. setInputWindows will still handle window state
changes such as visibility and focusability which can take focus away
from the currently focused window.

This change explicitly defines how mirrored window or windows sharing a
window token handles focus. For a window to be focusable, all the
windows sharing its window token must be focusable and at least one of
the window must be visible. This different from the previous behaviour
where z-order and the state of a single window determined focus via
setInputWindows.

In addition, if focus is requested on an invisible window, the request
is queued up until the window becomes focus or a new request is made.
Any key events are queued and delivered to the new window as it becomes
focused. This allows the system to deliver any key events to the new
window between the time that the system wants to show a new window and
the window is ready to receive input.

Test: atest inputflinger_tests
Test: atest CtsWindowManagerDeviceTestCases
Test: atest FlickerTests

Change-Id: Id09cce42f55fb7d36a3eb0aa9d28f6a44bd1cf07
10 files changed