summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteve Pfetsch <spfetsch@google.com>2020-09-02 18:02:52 -0700
committerTreeHugger Robot <treehugger-gerrit@google.com>2021-05-07 07:12:59 +0000
commitc5f72bce3360dc6261ec32846c2150a7ff7de18e (patch)
treed216b3b9cc6d28b1b3283057fcf718f694b0140c
parent507f6146a7dfd0c30f5c81c66c8a16d287c8a58d (diff)
downloadsec_touch-c5f72bce3360dc6261ec32846c2150a7ff7de18e.tar.gz
input: touchscreen: sec_ts: Report edge and palm touchesandroid-s-beta-2_r0.5android-msm-redbull-4.19-s-beta-2
Map edge, palm, and cancel touches to MT_TOOL_PALM, effectively allowing them to be treated as cancel events. Signed-off-by: Steve Pfetsch <spfetsch@google.com> Change-Id: I7fb1fa49942f5166da50a2e61753d6b0634b909a
-rw-r--r--sec_ts.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/sec_ts.c b/sec_ts.c
index b652480..5d05f73 100644
--- a/sec_ts.c
+++ b/sec_ts.c
@@ -2657,13 +2657,21 @@ static void sec_ts_offload_report(void *handle,
input_set_timestamp(ts->input_dev, report->timestamp);
for (i = 0; i < MAX_COORDS; i++) {
- if (report->coords[i].status == COORD_STATUS_FINGER) {
+ if (report->coords[i].status != COORD_STATUS_INACTIVE) {
+ int mt_tool = MT_TOOL_FINGER;
+
input_mt_slot(ts->input_dev, i);
touch_down = 1;
input_report_key(ts->input_dev, BTN_TOUCH,
touch_down);
+
+ if (report->coords[i].status == COORD_STATUS_EDGE ||
+ report->coords[i].status == COORD_STATUS_PALM ||
+ report->coords[i].status == COORD_STATUS_CANCEL)
+ mt_tool = MT_TOOL_PALM;
+
input_mt_report_slot_state(ts->input_dev,
- MT_TOOL_FINGER, 1);
+ mt_tool, 1);
input_report_abs(ts->input_dev, ABS_MT_POSITION_X,
report->coords[i].x);
input_report_abs(ts->input_dev, ABS_MT_POSITION_Y,