Modify native ALooper to take an explicit ident.

The ALooper API now uses an explicit "identifier" for the integer
that is returned rather than implicitly using the fd.  This allows
the APIs that had the fd to be a little more sane.

Change-Id: I8507f535ad484c0bdc4a1bd016d87bb09acd7ff0
This commit is contained in:
Dianne Hackborn
2010-09-07 15:28:30 -07:00
parent 6e86915e8f
commit 42c03e579a
11 changed files with 48 additions and 30 deletions

View File

@@ -60,12 +60,12 @@ ASensor const* ASensorManager_getDefaultSensor(ASensorManager* manager, int type
}
ASensorEventQueue* ASensorManager_createEventQueue(ASensorManager* manager,
ALooper* looper, ALooper_callbackFunc* callback, void* data)
ALooper* looper, int ident, ALooper_callbackFunc* callback, void* data)
{
sp<SensorEventQueue> queue =
static_cast<SensorManager*>(manager)->createEventQueue();
if (queue != 0) {
ALooper_addFd(looper, queue->getFd(), POLLIN, callback, data);
ALooper_addFd(looper, queue->getFd(), ident, POLLIN, callback, data);
queue->looper = looper;
queue->incStrong(manager);
}