diff options
author | 2010-09-07 15:28:30 -0700 | |
---|---|---|
committer | 2010-09-07 15:46:55 -0700 | |
commit | 42c03e579aade011b451e2a13ea3f44a2ef0056a (patch) | |
tree | 1716fbd88e2beb816d303c3d3fa0ca1785b8db61 /native/android | |
parent | 6e86915e8f5dfffa60ae5d1a4ca9aa74912fd026 (diff) |
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
Diffstat (limited to 'native/android')
-rw-r--r-- | native/android/input.cpp | 4 | ||||
-rw-r--r-- | native/android/looper.cpp | 4 | ||||
-rw-r--r-- | native/android/sensor.cpp | 4 |
3 files changed, 6 insertions, 6 deletions
diff --git a/native/android/input.cpp b/native/android/input.cpp index 379960a27c29..c79f913237ae 100644 --- a/native/android/input.cpp +++ b/native/android/input.cpp @@ -246,8 +246,8 @@ float AMotionEvent_getHistoricalOrientation(AInputEvent* motion_event, size_t po void AInputQueue_attachLooper(AInputQueue* queue, ALooper* looper, - ALooper_callbackFunc* callback, void* data) { - queue->attachLooper(looper, callback, data); + int ident, ALooper_callbackFunc* callback, void* data) { + queue->attachLooper(looper, ident, callback, data); } void AInputQueue_detachLooper(AInputQueue* queue) { diff --git a/native/android/looper.cpp b/native/android/looper.cpp index 1564c477d29e..0aeed7776efe 100644 --- a/native/android/looper.cpp +++ b/native/android/looper.cpp @@ -72,9 +72,9 @@ void ALooper_release(ALooper* looper) { static_cast<PollLoop*>(looper)->decStrong((void*)ALooper_acquire); } -void ALooper_addFd(ALooper* looper, int fd, int events, +void ALooper_addFd(ALooper* looper, int fd, int ident, int events, ALooper_callbackFunc* callback, void* data) { - static_cast<PollLoop*>(looper)->setLooperCallback(fd, events, callback, data); + static_cast<PollLoop*>(looper)->setLooperCallback(fd, ident, events, callback, data); } int32_t ALooper_removeFd(ALooper* looper, int fd) { diff --git a/native/android/sensor.cpp b/native/android/sensor.cpp index db534e09dab8..cf7635d2027f 100644 --- a/native/android/sensor.cpp +++ b/native/android/sensor.cpp @@ -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); } |