diff options
author | Jeff Brown <jeffbrown@google.com> | 2011-08-10 14:55:59 -0700 |
---|---|---|
committer | Jeff Brown <jeffbrown@google.com> | 2011-08-10 14:55:59 -0700 |
commit | d87c6d5fd5e620ecb1a7a401d2b31c6cf2e1a851 (patch) | |
tree | ab48f92be24decba74d368ac669a555c96a9f929 /services | |
parent | eee00495f5c65340bff80e8afa8090b3b18619de (diff) | |
download | frameworks_base-d87c6d5fd5e620ecb1a7a401d2b31c6cf2e1a851.zip frameworks_base-d87c6d5fd5e620ecb1a7a401d2b31c6cf2e1a851.tar.gz frameworks_base-d87c6d5fd5e620ecb1a7a401d2b31c6cf2e1a851.tar.bz2 |
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')
-rw-r--r-- | services/input/InputReader.cpp | 13 | ||||
-rw-r--r-- | services/input/InputReader.h | 2 |
2 files changed, 7 insertions, 8 deletions
diff --git a/services/input/InputReader.cpp b/services/input/InputReader.cpp index 8786c24..dacc73f 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); } diff --git a/services/input/InputReader.h b/services/input/InputReader.h index f5d095d..e82c4e7 100644 --- a/services/input/InputReader.h +++ b/services/input/InputReader.h @@ -526,7 +526,7 @@ public: uint32_t getButtonState() const; int32_t getToolType() const; - bool isActive() const; + bool isToolActive() const; bool isHovering() const; private: |