Validate indices when requesting PointerCoords

We are investigating a crash in PointerCoords. To further understand
what kind of MotionEvents we are dealing with, let's add some assertions
to the PointerCoords that we are producing.

It's possible that pointerCount is zero, for example. This would help us
further narrow down the issue.

In this CL, we are also adding a way to dump MotionEvent. This was
loosely following MotionEvent.java::toString() method. At some point, we
should remove the Java method implementation and replace it with a
single jni call to native. That work is out of scope for this CL.

In the jni layer, we can't remove the error checking/exception raising,
because someone might be catching an exception and moving on, and a
native crash would break this pattern. We can consider doing that in the
future under an experiment flag, though.

Bug: 233163975
Test: printed MotionEvent in log to see the formatting
Change-Id: I4f641c0cb89526a06146e4c0cf3a5fab2faa42f8
2 files changed