diff options
author | Jeff Brown <jeffbrown@google.com> | 2010-09-13 23:17:30 -0700 |
---|---|---|
committer | Jeff Brown <jeffbrown@google.com> | 2010-09-14 01:59:45 -0700 |
commit | 59abe7e0909bf4b7bf7b9601e1e40a05f6d4fd8a (patch) | |
tree | 461f56e9bdc9a3206543f729409ba23e7124dd29 /include/ui | |
parent | 37163248adf9e8e5786b2bc1424efa04efd07252 (diff) | |
download | frameworks_native-59abe7e0909bf4b7bf7b9601e1e40a05f6d4fd8a.zip frameworks_native-59abe7e0909bf4b7bf7b9601e1e40a05f6d4fd8a.tar.gz frameworks_native-59abe7e0909bf4b7bf7b9601e1e40a05f6d4fd8a.tar.bz2 |
Replace epoll() with poll() and rename PollLoop to Looper.
As part of this change, consolidated and cleaned up the Looper API so
that there are fewer distinctions between the NDK and non-NDK declarations
(no need for two callback types, etc.).
Removed the dependence on specific constants from sys/poll.h such as
POLLIN. Instead looper.h defines events like LOOPER_EVENT_INPUT for
the events that it supports. That should help make any future
under-the-hood implementation changes easier.
Fixed a couple of compiler warnings along the way.
Change-Id: I449a7ec780bf061bdd325452f823673e2b39b6ae
Diffstat (limited to 'include/ui')
-rw-r--r-- | include/ui/InputDispatcher.h | 8 | ||||
-rw-r--r-- | include/ui/InputTransport.h | 1 |
2 files changed, 4 insertions, 5 deletions
diff --git a/include/ui/InputDispatcher.h b/include/ui/InputDispatcher.h index a06208a..d7e6254 100644 --- a/include/ui/InputDispatcher.h +++ b/include/ui/InputDispatcher.h @@ -25,7 +25,7 @@ #include <utils/Timers.h> #include <utils/RefBase.h> #include <utils/String8.h> -#include <utils/PollLoop.h> +#include <utils/Looper.h> #include <utils/Pool.h> #include <stddef.h> @@ -826,7 +826,7 @@ private: Mutex mLock; Allocator mAllocator; - sp<PollLoop> mPollLoop; + sp<Looper> mLooper; EventEntry* mPendingEvent; Queue<EventEntry> mInboundQueue; @@ -837,7 +837,7 @@ private: void dispatchOnceInnerLocked(nsecs_t keyRepeatTimeout, nsecs_t keyRepeatDelay, nsecs_t* nextWakeupTime); - // Enqueues an inbound event. Returns true if mPollLoop->wake() should be called. + // Enqueues an inbound event. Returns true if mLooper->wake() should be called. bool enqueueInboundEventLocked(EventEntry* entry); // App switch latency optimization. @@ -1010,7 +1010,7 @@ private: void abortDispatchCycleLocked(nsecs_t currentTime, const sp<Connection>& connection, bool broken); void drainOutboundQueueLocked(Connection* connection, DispatchEntry* firstDispatchEntryToDrain); - static bool handleReceiveCallback(int receiveFd, int events, void* data); + static int handleReceiveCallback(int receiveFd, int events, void* data); // Preempting input dispatch. bool preemptInputDispatchInnerLocked(); diff --git a/include/ui/InputTransport.h b/include/ui/InputTransport.h index 82831e2..dc9e27a 100644 --- a/include/ui/InputTransport.h +++ b/include/ui/InputTransport.h @@ -33,7 +33,6 @@ #include <semaphore.h> #include <ui/Input.h> #include <utils/Errors.h> -#include <utils/PollLoop.h> #include <utils/Timers.h> #include <utils/RefBase.h> #include <utils/String8.h> |