From 8b4be56030c3b8c93dfa45bccac7365f90f377ce Mon Sep 17 00:00:00 2001 From: Jeff Brown Date: Mon, 6 Feb 2012 16:31:05 -0800 Subject: [PATCH] Delete premature optimization. This is part of a series of changes to improve input system pipelining. Bug: 5963420 Change-Id: I5c182f6e17d468bf3033125b2094b2baa5b94e81 --- services/input/InputDispatcher.cpp | 12 ++++++------ services/input/InputDispatcher.h | 2 -- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/services/input/InputDispatcher.cpp b/services/input/InputDispatcher.cpp index 436831f38d9fa..9da709d65abe6 100644 --- a/services/input/InputDispatcher.cpp +++ b/services/input/InputDispatcher.cpp @@ -2076,19 +2076,19 @@ void InputDispatcher::synthesizeCancelationEventsForConnectionLocked( nsecs_t currentTime = now(); - mTempCancelationEvents.clear(); + Vector cancelationEvents; connection->inputState.synthesizeCancelationEvents(currentTime, - mTempCancelationEvents, options); + cancelationEvents, options); - if (!mTempCancelationEvents.isEmpty()) { + if (!cancelationEvents.isEmpty()) { #if DEBUG_OUTBOUND_EVENT_DETAILS ALOGD("channel '%s' ~ Synthesized %d cancelation events to bring channel back in sync " "with reality: %s, mode=%d.", - connection->getInputChannelName(), mTempCancelationEvents.size(), + connection->getInputChannelName(), cancelationEvents.size(), options.reason, options.mode); #endif - for (size_t i = 0; i < mTempCancelationEvents.size(); i++) { - EventEntry* cancelationEventEntry = mTempCancelationEvents.itemAt(i); + for (size_t i = 0; i < cancelationEvents.size(); i++) { + EventEntry* cancelationEventEntry = cancelationEvents.itemAt(i); switch (cancelationEventEntry->type) { case EventEntry::TYPE_KEY: logOutboundKeyDetailsLocked("cancel - ", diff --git a/services/input/InputDispatcher.h b/services/input/InputDispatcher.h index d6eab5af019b5..70d4546ec059a 100644 --- a/services/input/InputDispatcher.h +++ b/services/input/InputDispatcher.h @@ -814,8 +814,6 @@ private: Queue mInboundQueue; Queue mCommandQueue; - Vector mTempCancelationEvents; - void dispatchOnceInnerLocked(nsecs_t* nextWakeupTime); // Enqueues an inbound event. Returns true if mLooper->wake() should be called.