Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2bb10f42 authored by Kenny Root's avatar Kenny Root
Browse files

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
parent 795e42e9
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -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) {