diff options
author | Super Liu <supercjliu@google.com> | 2023-05-10 07:38:59 +0000 |
---|---|---|
committer | Treehugger Robot <android-test-infra-autosubmit@system.gserviceaccount.com> | 2023-05-11 01:38:53 +0000 |
commit | 4478ebfef62b6d61749bae61cc15c02d99d4a798 (patch) | |
tree | df7bb8611fd87e969f054a5f226f316bef610f14 | |
parent | d4f4c33951ea9f32139046ac596cc1184fad8d3e (diff) | |
download | common-4478ebfef62b6d61749bae61cc15c02d99d4a798.tar.gz |
gti: Avoid input reporting with zero pressure
Bug: 280550428
Change-Id: I159069dcfecdf0959550f65e13124c3505521c09
Signed-off-by: Super Liu <supercjliu@google.com>
-rw-r--r-- | goog_touch_interface.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/goog_touch_interface.c b/goog_touch_interface.c index 1758aa9..d3ceb53 100644 --- a/goog_touch_interface.c +++ b/goog_touch_interface.c @@ -2399,7 +2399,9 @@ void goog_offload_input_report(void *handle, input_report_abs(gti->vendor_input_dev, ABS_MT_TOUCH_MINOR, report->coords[i].minor); input_report_abs(gti->vendor_input_dev, ABS_MT_PRESSURE, - report->coords[i].pressure); + max_t(int, 1, report->coords[i].pressure)); + if (report->coords[i].pressure == 0) + GOOG_WARN(gti, "Unexpected ZERO pressure reporting(slot#%d)!", i); if (gti->offload.caps.rotation_reporting) input_report_abs(gti->vendor_input_dev, ABS_MT_ORIENTATION, report->coords[i].rotation); |