diff options
| author | 2011-08-11 15:49:09 -0700 | |
|---|---|---|
| committer | 2011-08-11 15:54:54 -0700 | |
| commit | 8bcbbefa3b4e149099b2057547543ea95a7be400 (patch) | |
| tree | 79483141865d98beea4de3792a7541202978db46 | |
| parent | a1f89ceec076392da409e9f389b33e62e1d92da6 (diff) | |
Exorcise notification panel ghosts.
Bug: 5105599
Don't clear slot data when slot is no longer in use.
The kernel will not resend absolute slot values if they are
unchanged, even if the slot was previously marked unused.
Because the protocol is stateful, this could cause problems if
evdev drops events (marked by SYN_DROPPED) since we cannot
query the initial values of the slots, but there's nothing
we can do.
Change-Id: Ie13e68097fb8ed2542c2f60338b499082cf9e77f
| -rw-r--r-- | services/input/InputReader.cpp | 12 | ||||
| -rw-r--r-- | services/input/InputReader.h | 1 |
2 files changed, 4 insertions, 9 deletions
diff --git a/services/input/InputReader.cpp b/services/input/InputReader.cpp index 80e754756ab2..2035a4b56ff3 100644 --- a/services/input/InputReader.cpp +++ b/services/input/InputReader.cpp @@ -1335,7 +1335,7 @@ void MultiTouchMotionAccumulator::configure(size_t slotCount, bool usingSlotsPro void MultiTouchMotionAccumulator::clearSlots(int32_t initialSlot) { for (size_t i = 0; i < mSlotCount; i++) { - mSlots[i].clearIfInUse(); + mSlots[i].clear(); } mCurrentSlot = initialSlot; } @@ -1396,7 +1396,9 @@ void MultiTouchMotionAccumulator::process(const RawEvent* rawEvent) { break; case ABS_MT_TRACKING_ID: if (mUsingSlotsProtocol && rawEvent->value < 0) { - slot->clearIfInUse(); + // The slot is no longer in use but it retains its previous contents, + // which may be reused for subsequent touches. + slot->mInUse = false; } else { slot->mInUse = true; slot->mAbsMTTrackingId = rawEvent->value; @@ -1430,12 +1432,6 @@ MultiTouchMotionAccumulator::Slot::Slot() { clear(); } -void MultiTouchMotionAccumulator::Slot::clearIfInUse() { - if (mInUse) { - clear(); - } -} - void MultiTouchMotionAccumulator::Slot::clear() { mInUse = false; mHaveAbsMTTouchMinor = false; diff --git a/services/input/InputReader.h b/services/input/InputReader.h index de75cad70acd..72802fc7fab7 100644 --- a/services/input/InputReader.h +++ b/services/input/InputReader.h @@ -696,7 +696,6 @@ public: int32_t mAbsMTToolType; Slot(); - void clearIfInUse(); void clear(); }; |