diff options
| author | 2011-08-10 14:55:59 -0700 | |
|---|---|---|
| committer | 2011-08-10 14:55:59 -0700 | |
| commit | d87c6d5fd5e620ecb1a7a401d2b31c6cf2e1a851 (patch) | |
| tree | ab48f92be24decba74d368ac669a555c96a9f929 /services/input/InputReader.cpp | |
| parent | eee00495f5c65340bff80e8afa8090b3b18619de (diff) | |
Use BTN_TOUCH or BTN_TOOL_* to determine if touch active.
Bug: 5064702
Should not include stylus buttons in the condition.
Change-Id: If4d78a875b77da8bd59672d6fdbf5353004d0023
Diffstat (limited to 'services/input/InputReader.cpp')
| -rw-r--r-- | services/input/InputReader.cpp | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/services/input/InputReader.cpp b/services/input/InputReader.cpp index 8786c24da624..dacc73f41d25 100644 --- a/services/input/InputReader.cpp +++ b/services/input/InputReader.cpp @@ -1170,9 +1170,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 +5143,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 +5167,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); } |