Acquire a reference on the given ALooper object. This prevents the object
from being deleted until the reference is removed. This is only needed
to safely hand an ALooper from one thread to another.
Like ALooper_pollOnce(), but performs all pending callbacks until all
data has been consumed or a file descriptor is available with no callback.
This function will never return ALOOPER_POLL_CALLBACK.
Prepares a looper associated with the calling thread, and returns it.
If the thread already has a looper, it is returned. Otherwise, a new
one is created, associated with the thread, and returned.
For callback-based event loops, this is the prototype of the function
that is called when a file descriptor event occurs.
It is given the file descriptor it is associated with,
a bitmask of the poll events that were triggered (typically ALOOPER_EVENT_INPUT),
and the data pointer that was originally supplied.