Store pending connected view when requesting focus
Before this change, HandwritingInitiator would request focus for a
handwriting view when it detected stylus movement on the view, and
expect an InputConnection to be created for that view.
However, in some apps, an InputConnection could be created for a
different view, before the InputConnection for the focus requested view
is created (for example, see b/286289041). This would cause handwriting
initiation to fail.
To handle this case, HandwritingInitiator stores a reference to the view
when it requests focus, then waits for the InputConnection to be created
for that view, and ignores any other InputConnections created in the
meantime.
Bug: 286287855
Test: atest HandwritingInitiatorTest
Change-Id: I63ca718e1ac7221f28aa6f4c6dd1d66974e12118
2 files changed