Set MotionEvent toolType to TOOL_TYPE_FINGER

When dispatching touch events, we should make sure to set the toolType,
otherwise the MotionEvent will assume the default (TOOL_TYPE_UNKNOWN).

Not specifying the toolType might make the framework to make assumptions
and react in an undesirable manner. For example, the Compose framework
checks if the toolType is TOOL_TYPE_FINGER when handling a motion event
that goes off bounds in order to differentiate a drag from a hover. If
we do not set the MotionEvent toolType properly, dragging off bounds in
Compose Interactive Preview will be interpreted as an "Exit" (mouse
hover) event, and that puts Compose's dragging state machine in an
inconsistent state, which results in a crash, freezing the Preview.

Change-Id: I7f7f2b195af69999e929cb22d10b224f1c4de3d2
Fixes: 201946951
Test: Tested from Studio
1 file changed