summaryrefslogtreecommitdiffstats
path: root/services/inputflinger/InputReader.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'services/inputflinger/InputReader.cpp')
-rw-r--r--services/inputflinger/InputReader.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/services/inputflinger/InputReader.cpp b/services/inputflinger/InputReader.cpp
index 8634e42..ccf8ced 100644
--- a/services/inputflinger/InputReader.cpp
+++ b/services/inputflinger/InputReader.cpp
@@ -1078,6 +1078,14 @@ void InputDevice::cancelVibrate(int32_t token) {
}
}
+void InputDevice::cancelTouch(nsecs_t when) {
+ size_t numMappers = mMappers.size();
+ for (size_t i = 0; i < numMappers; i++) {
+ InputMapper* mapper = mMappers[i];
+ mapper->cancelTouch(when);
+ }
+}
+
int32_t InputDevice::getMetaState() {
int32_t result = 0;
size_t numMappers = mMappers.size();
@@ -1786,6 +1794,9 @@ void InputMapper::vibrate(const nsecs_t* pattern, size_t patternSize, ssize_t re
void InputMapper::cancelVibrate(int32_t token) {
}
+void InputMapper::cancelTouch(nsecs_t when) {
+}
+
int32_t InputMapper::getMetaState() {
return 0;
}
@@ -2134,6 +2145,9 @@ void KeyboardInputMapper::processKey(nsecs_t when, bool down, int32_t keyCode,
getDevice(), keyCode, scanCode)) {
return;
}
+ if (policyFlags & POLICY_FLAG_GESTURE) {
+ mDevice->cancelTouch(when);
+ }
mKeyDowns.push();
KeyDown& keyDown = mKeyDowns.editTop();
@@ -5717,6 +5731,10 @@ void TouchInputMapper::fadePointer() {
}
}
+void TouchInputMapper::cancelTouch(nsecs_t when) {
+ abortPointerUsage(when, 0 /*policyFlags*/);
+}
+
bool TouchInputMapper::isPointInsideSurface(int32_t x, int32_t y) {
return x >= mRawPointerAxes.x.minValue && x <= mRawPointerAxes.x.maxValue
&& y >= mRawPointerAxes.y.minValue && y <= mRawPointerAxes.y.maxValue;