summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSiarhei Vishniakou <svv@google.com>2022-08-25 18:23:35 +0000
committerSiarhei Vishniakou <svv@google.com>2022-09-09 20:38:56 +0000
commitbc17b161dfa8d983a816188cc9f9fa827de55abf (patch)
treec061499d5b393535b4bd750cf09b65c2b5c8dd9c
parent7ee2b25c0f398ed9872841b552446a27a580a4ea (diff)
downloadlibpalmrejection-bc17b161dfa8d983a816188cc9f9fa827de55abf.tar.gz
Correct condition for early detection
The condition should use the entire stroke, not recent samples. This was not "really" a bug because it would never get triggered. In practice today, samples().size() would reach max, and then it would permanently stay there. But semantically, it makes more sense to consider the entire stroke's duration. Bug: b/240168494 Test: autoninja -C out/Default events_unittests Change-Id: I66e5d0bce46909a329eb7d43448950a5f3503266 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3854948 Reviewed-by: Rob Schonberger <robsc@chromium.org> Commit-Queue: Siarhei Vishniakou <svv@google.com> Auto-Submit: Siarhei Vishniakou <svv@google.com> Cr-Commit-Position: refs/heads/main@{#1039338}
-rw-r--r--ui/events/ozone/evdev/touch_filter/neural_stylus_palm_detection_filter.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/ui/events/ozone/evdev/touch_filter/neural_stylus_palm_detection_filter.cc b/ui/events/ozone/evdev/touch_filter/neural_stylus_palm_detection_filter.cc
index 6b7e60b..6b91d1b 100644
--- a/ui/events/ozone/evdev/touch_filter/neural_stylus_palm_detection_filter.cc
+++ b/ui/events/ozone/evdev/touch_filter/neural_stylus_palm_detection_filter.cc
@@ -195,7 +195,7 @@ void NeuralStylusPalmDetectionFilter::Filter(
PalmFilterStroke& stroke = stroke_it->second;
if (end_of_stroke) {
// This is a stroke that hasn't had a decision yet, so we force decide.
- if (stroke.samples().size() < config.max_sample_count) {
+ if (stroke.samples_seen() < config.max_sample_count) {
slots_to_decide.insert(slot);
}