summaryrefslogtreecommitdiffstats
path: root/core/jni/android_app_NativeActivity.cpp
diff options
context:
space:
mode:
authorKenny Root <kroot@google.com>2011-02-22 15:00:35 -0800
committerKenny Root <kroot@google.com>2011-02-22 15:29:21 -0800
commit2bb10f4299f93f809bddb7683f6ba93277da6f28 (patch)
treeaf0faf3daa0e2f6bfb74cf46255dd7344f5ce973 /core/jni/android_app_NativeActivity.cpp
parent795e42e91ad049d7ddf5c3672a40f044fbc4d1e2 (diff)
downloadframeworks_base-2bb10f4299f93f809bddb7683f6ba93277da6f28.zip
frameworks_base-2bb10f4299f93f809bddb7683f6ba93277da6f28.tar.gz
frameworks_base-2bb10f4299f93f809bddb7683f6ba93277da6f28.tar.bz2
Fix poll options for NativeActivity's hasEvents
NativeActivity created a pipe to wake up a Looper it's attached to, but it failed to set the right options for the read part of the pipe. This affects only the NativeActivity API call for AInputQueue_hasEvents Change-Id: I02e5dad4e700f4c724b3187a4b7e0df931dd1eed
Diffstat (limited to 'core/jni/android_app_NativeActivity.cpp')
-rw-r--r--core/jni/android_app_NativeActivity.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/core/jni/android_app_NativeActivity.cpp b/core/jni/android_app_NativeActivity.cpp
index 0430a81..56f2646 100644
--- a/core/jni/android_app_NativeActivity.cpp
+++ b/core/jni/android_app_NativeActivity.cpp
@@ -150,12 +150,12 @@ int32_t AInputQueue::hasEvents() {
pfd[0].events = POLLIN;
pfd[0].revents = 0;
pfd[1].fd = mDispatchKeyRead;
- pfd[0].events = POLLIN;
- pfd[0].revents = 0;
+ pfd[1].events = POLLIN;
+ pfd[1].revents = 0;
int nfd = poll(pfd, 2, 0);
if (nfd <= 0) return 0;
- return (pfd[0].revents == POLLIN || pfd[1].revents == POLLIN) ? 1 : -1;
+ return ((pfd[0].revents & POLLIN) || (pfd[1].revents & POLLIN)) ? 1 : -1;
}
int32_t AInputQueue::getEvent(AInputEvent** outEvent) {