summaryrefslogtreecommitdiffstats
path: root/services/input/InputReader.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'services/input/InputReader.cpp')
-rw-r--r--services/input/InputReader.cpp22
1 files changed, 15 insertions, 7 deletions
diff --git a/services/input/InputReader.cpp b/services/input/InputReader.cpp
index 8786c24..2eacbeb 100644
--- a/services/input/InputReader.cpp
+++ b/services/input/InputReader.cpp
@@ -731,6 +731,15 @@ void InputReader::dump(String8& dump) {
mConfig.pointerGestureZoomSpeedRatio);
}
+void InputReader::monitor() {
+ // Acquire and release the lock to ensure that the reader has not deadlocked.
+ mLock.lock();
+ mLock.unlock();
+
+ // Check the EventHub
+ mEventHub->monitor();
+}
+
// --- InputReader::ContextImpl ---
@@ -1170,9 +1179,8 @@ int32_t TouchButtonAccumulator::getToolType() const {
return AMOTION_EVENT_TOOL_TYPE_UNKNOWN;
}
-bool TouchButtonAccumulator::isActive() const {
- return mBtnTouch || mBtnToolFinger || mBtnToolPen
- || mBtnToolRubber || mBtnStylus || mBtnStylus2;
+bool TouchButtonAccumulator::isToolActive() const {
+ return mBtnTouch || mBtnToolFinger || mBtnToolPen || mBtnToolRubber;
}
bool TouchButtonAccumulator::isHovering() const {
@@ -5144,7 +5152,7 @@ void SingleTouchInputMapper::sync(nsecs_t when) {
mCurrentRawPointerData.clear();
mCurrentButtonState = 0;
- if (mTouchButtonAccumulator.isActive()) {
+ if (mTouchButtonAccumulator.isToolActive()) {
mCurrentRawPointerData.pointerCount = 1;
mCurrentRawPointerData.idToIndex[0] = 0;
@@ -5168,11 +5176,11 @@ void SingleTouchInputMapper::sync(nsecs_t when) {
outPointer.toolType = AMOTION_EVENT_TOOL_TYPE_FINGER;
}
outPointer.isHovering = isHovering;
-
- mCurrentButtonState = mTouchButtonAccumulator.getButtonState()
- | mCursorButtonAccumulator.getButtonState();
}
+ mCurrentButtonState = mTouchButtonAccumulator.getButtonState()
+ | mCursorButtonAccumulator.getButtonState();
+
syncTouch(when, true);
}