summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKenny Root <kroot@google.com>2011-02-22 16:08:42 -0800
committerAndroid (Google) Code Review <android-gerrit@google.com>2011-02-22 16:08:42 -0800
commit1665da555d9795fbb8a91b22579e5dd9257a1220 (patch)
tree5ac48f13df182d784b375aab681c3d95c90536b3
parent2bbe178fea051e0c92892e4875ed19f6652b48b6 (diff)
parent2bb10f4299f93f809bddb7683f6ba93277da6f28 (diff)
downloadframeworks_base-1665da555d9795fbb8a91b22579e5dd9257a1220.zip
frameworks_base-1665da555d9795fbb8a91b22579e5dd9257a1220.tar.gz
frameworks_base-1665da555d9795fbb8a91b22579e5dd9257a1220.tar.bz2
Merge "Fix poll options for NativeActivity's hasEvents"
-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) {