firmware_TouchMTB: fix Mtb State Machine to keep the last packet

Fix the MtbStateMachine class so that it keeps the last packet.
When the event ABS_MT_TRACKING_ID = -1 is observed, do not delete
the slot immediately. Instead, wait until all events in that packet
are saved.

The reason for keeping the last packet is as follows. In some cases,
the last packet is required in order to show an abnormal large
report interval incurred by the last packet.

BUG=chromium:289349
TEST=Conduct unit tests on a chromebook or in chroot.
$ cd /usr/local/autotest/tests/firmware_TouchMTB
$ python tests/run_all_unittests.py
The unit tests must all pass.

Change-Id: I32bf59786bc14bf848264f9ed288fee465ce4b5d
Reviewed-on: https://chromium-review.googlesource.com/168907
Reviewed-by: Charles Mooney <charliemooney@chromium.org>
Tested-by: Shyh-In Hwang <josephsih@chromium.org>
Commit-Queue: Shyh-In Hwang <josephsih@chromium.org>
3 files changed