gti: force to cancel the active fingers during screen-off
Bug: 302069761
Change-Id: Id2ebb392082ae4cd08f80e37a83c14e7bea9a1bd
Signed-off-by: Super Liu <supercjliu@google.com>
(cherry picked from commit 9a2c5a473ed7c4fdd29fee65580ba79a898fdb39)
diff --git a/goog_touch_interface.c b/goog_touch_interface.c
index 9b88724..3bb1db5 100644
--- a/goog_touch_interface.c
+++ b/goog_touch_interface.c
@@ -2189,6 +2189,15 @@
clear_bit(i, &slot_bit_active);
input_mt_slot(gti->vendor_input_dev, i);
input_report_abs(gti->vendor_input_dev, ABS_MT_PRESSURE, 0);
+ /*
+ * Force to cancel the active figner(s) by MT_TOOL_PALM during screen-off.
+ */
+ if (gti->display_state == GTI_DISPLAY_STATE_OFF &&
+ gti->vendor_input_dev->mt &&
+ input_mt_is_active(>i->vendor_input_dev->mt->slots[i])) {
+ input_mt_report_slot_state(gti->vendor_input_dev, MT_TOOL_PALM, 1);
+ input_sync(gti->vendor_input_dev);
+ }
input_mt_report_slot_state(gti->vendor_input_dev, MT_TOOL_FINGER, 0);
input_report_abs(gti->vendor_input_dev, ABS_MT_TRACKING_ID, -1);
}