summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSiarhei Vishniakou <svv@google.com>2022-09-13 16:57:04 +0000
committerAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>2022-09-13 16:57:04 +0000
commit67e0b0a65a268fbf58bb6df694aa6f7643014b5f (patch)
treef64eaa73cc7618ce71291c5eec3195cf95e46d2d
parentcfbe6496133cf7de39e5f9d33109f96b6af71288 (diff)
parent7ee2b25c0f398ed9872841b552446a27a580a4ea (diff)
downloadlibpalmrejection-67e0b0a65a268fbf58bb6df694aa6f7643014b5f.tar.gz
Simplify condition in ShouldDecideStroke am: 7ee2b25c0f
Original change: https://googleplex-android-review.googlesource.com/c/platform/external/libpalmrejection/+/19914650 Change-Id: I9fb9a1988eeb94f6a5e684996ec99c1d9c124ab5 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
-rw-r--r--ui/events/ozone/evdev/touch_filter/neural_stylus_palm_detection_filter.cc10
1 files changed, 2 insertions, 8 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 49c2a4e..6b7e60b 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
@@ -272,14 +272,8 @@ void NeuralStylusPalmDetectionFilter::Filter(
bool NeuralStylusPalmDetectionFilter::ShouldDecideStroke(
const PalmFilterStroke& stroke) const {
const NeuralStylusPalmDetectionFilterModelConfig& config = model_->config();
- // Perform inference at most every |max_sample_count| samples.
- if (stroke.samples_seen() % config.max_sample_count != 0)
- return false;
-
- // Only inference at start.
- if (stroke.samples_seen() > config.max_sample_count)
- return false;
- return true;
+ // Inference only executed once per stroke
+ return stroke.samples_seen() == config.max_sample_count;
}
bool NeuralStylusPalmDetectionFilter::IsHeuristicPalmStroke(