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.

TEST=Based on
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)


Change-Id: Ib30c43f55439a5bb45e0c983f8a8d5057e056048
Reviewed-by: Andrew de los Reyes <>
Commit-Queue: Tai-Hsu Lin <>
Tested-by: Tai-Hsu Lin <>
3 files changed