Add support for the metrics gesture

This patch adds support for the metrics gesture (GestureMetrics) in
cmt. The metrics gesture is used to expose vital stats that we
would like to catch with the UMA system in Chrome. We currently catches
the ground noise pattern and send them with the metrics gesture.

BUG=chromium:237683
TEST=Based on https://gerrit.chromium.org/gerrit/55727/
On link:
$ DISPLAY=:0.0 xinput list-props 11 | grep "Metrics"

One should see:
        Metrics Noisy Ground Distance (403):    10.000000
        Metrics Noisy Ground Time (404):        0.100000

To watch for the metrics gesture, use command:
$ DISPLAY=:0.0 xinput test-xi2 11 | grep "9:"

With the default distance threshold (10.0), it should be impossible
to trigger the check. Try to quickly move finger on the touchpad and
make sure no line shows up. Now, change the threshold value to 0.1 with
the following line:

$ DISPLAY=:0.0 xinput set-float-prop 11 403 0.1

Quickly move finger back and forth on the touchpad again, one should
now see various lines coming up with the above watch command:

$ DISPLAY=:0.0 xinput test-xi2 11 | grep "9:"
                      Detail for Valuator 9:
                9: 0.00 (0.00)
                9: 0.00 (0.00)
                9: 0.00 (0.00)
                9: 0.00 (0.00)
                ...

CQ-DEPEND=I5e6c9bd5489f4e5aeb90e0d7d7f48cd3e068d08f

Change-Id: Ib30c43f55439a5bb45e0c983f8a8d5057e056048
Reviewed-on: https://gerrit.chromium.org/gerrit/55729
Reviewed-by: Andrew de los Reyes <adlr@chromium.org>
Commit-Queue: Tai-Hsu Lin <sheckylin@chromium.org>
Tested-by: Tai-Hsu Lin <sheckylin@chromium.org>
3 files changed