summaryrefslogtreecommitdiff
path: root/services/inputflinger/InputClassifier.cpp
diff options
context:
space:
mode:
author Siarhei Vishniakou <svv@google.com> 2021-11-12 20:08:38 -0800
committer Siarhei Vishniakou <svv@google.com> 2021-11-15 13:54:52 -0800
commitd948957b396a9301e6e247023d8509f44f6cf87c (patch)
treea8f38f159912be41d6e7de248c3f6907015f4b0c /services/inputflinger/InputClassifier.cpp
parentc9963a2d6e1b8751541fa395115311bd50b90b87 (diff)
Look up source using & instead of equality
Source for an input device may be composite. On some devices, the source is specified as TOUCHSCREEN | STYLUS. That means a regular lookup of a MotionRange using just SOURCE_TOUCHSCREEN fails. Update the code to allow composite sources. Also, improve the source dump by printing words instead of numbers. Bug: 198472780 Test: adb shell dumpsys input Change-Id: I8d395f2bb5a6db031e5c2aa6c1f5152ff067a2bb
Diffstat (limited to 'services/inputflinger/InputClassifier.cpp')
-rw-r--r--services/inputflinger/InputClassifier.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/services/inputflinger/InputClassifier.cpp b/services/inputflinger/InputClassifier.cpp
index 29d8a0f441..19cad7b9ad 100644
--- a/services/inputflinger/InputClassifier.cpp
+++ b/services/inputflinger/InputClassifier.cpp
@@ -68,7 +68,8 @@ static MotionClassification getMotionClassification(common::V1_0::Classification
}
static bool isTouchEvent(const NotifyMotionArgs& args) {
- return args.source == AINPUT_SOURCE_TOUCHPAD || args.source == AINPUT_SOURCE_TOUCHSCREEN;
+ return isFromSource(args.source, AINPUT_SOURCE_TOUCHPAD) ||
+ isFromSource(args.source, AINPUT_SOURCE_TOUCHSCREEN);
}
// --- ClassifierEvent ---