diff options
author | Jeff Brown <jeffbrown@google.com> | 2011-06-02 18:22:25 -0700 |
---|---|---|
committer | Jeff Brown <jeffbrown@google.com> | 2011-06-02 18:29:10 -0700 |
commit | 441a9c28f5831974905a3aee238d741461138ed5 (patch) | |
tree | 94463fef02fd262c78695a62ebb8436796753ee3 /services/input | |
parent | 8f40e5871213afb63ae4b68a44dd09e0a014e417 (diff) | |
download | frameworks_base-441a9c28f5831974905a3aee238d741461138ed5.zip frameworks_base-441a9c28f5831974905a3aee238d741461138ed5.tar.gz frameworks_base-441a9c28f5831974905a3aee238d741461138ed5.tar.bz2 |
Fix ABS_MT_SLOT handling.
Shouldn't reset the current slot index to 0 after each SYN_REPORT.
Change-Id: I370e4770f8ae0ce598369ecbaf64772c13e02d46
Diffstat (limited to 'services/input')
-rw-r--r-- | services/input/InputReader.cpp | 12 | ||||
-rw-r--r-- | services/input/InputReader.h | 8 |
2 files changed, 13 insertions, 7 deletions
diff --git a/services/input/InputReader.cpp b/services/input/InputReader.cpp index 25a2c78..d0a93ec 100644 --- a/services/input/InputReader.cpp +++ b/services/input/InputReader.cpp @@ -5303,7 +5303,8 @@ MultiTouchInputMapper::~MultiTouchInputMapper() { } void MultiTouchInputMapper::clearState() { - mAccumulator.clear(mSlotCount); + mAccumulator.clearSlots(mSlotCount); + mAccumulator.clearButtons(); mButtonState = 0; } @@ -5337,13 +5338,13 @@ void MultiTouchInputMapper::process(const RawEvent* rawEvent) { } if (mAccumulator.currentSlot < 0 || size_t(mAccumulator.currentSlot) >= mSlotCount) { - if (newSlot) { #if DEBUG_POINTERS + if (newSlot) { LOGW("MultiTouch device %s emitted invalid slot index %d but it " "should be between 0 and %d; ignoring this slot.", getDeviceName().string(), mAccumulator.currentSlot, mSlotCount); -#endif } +#endif break; } @@ -5546,7 +5547,10 @@ void MultiTouchInputMapper::sync(nsecs_t when) { syncTouch(when, havePointerIds); - mAccumulator.clear(mUsingSlotsProtocol ? 0 : mSlotCount); + if (!mUsingSlotsProtocol) { + mAccumulator.clearSlots(mSlotCount); + } + mAccumulator.clearButtons(); } void MultiTouchInputMapper::configureRawAxes() { diff --git a/services/input/InputReader.h b/services/input/InputReader.h index 85338b6..5b9a4ee 100644 --- a/services/input/InputReader.h +++ b/services/input/InputReader.h @@ -1235,8 +1235,7 @@ private: uint32_t buttonDown; uint32_t buttonUp; - Accumulator() : slots(NULL) { - clear(false); + Accumulator() : currentSlot(0), slots(NULL), buttonDown(0), buttonUp(0) { } ~Accumulator() { @@ -1247,11 +1246,14 @@ private: slots = new Slot[slotCount]; } - void clear(size_t slotCount) { + void clearSlots(size_t slotCount) { for (size_t i = 0; i < slotCount; i++) { slots[i].clear(); } currentSlot = 0; + } + + void clearButtons() { buttonDown = 0; buttonUp = 0; } |