diff options
author | Jeff Brown <jeffbrown@google.com> | 2011-01-16 16:58:57 -0800 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2011-01-16 16:58:57 -0800 |
commit | 04970d654d96404cff60f774c1b7a02da03c75fd (patch) | |
tree | 5b8a00a05e19dd76cce505521b6b5f629de2b696 /native | |
parent | 3530ebe451fea39b159baa9b8c9f9cd851de42a3 (diff) | |
parent | 3392b8e23e7eb0275071af621802ed04c829c911 (diff) | |
download | frameworks_base-04970d654d96404cff60f774c1b7a02da03c75fd.zip frameworks_base-04970d654d96404cff60f774c1b7a02da03c75fd.tar.gz frameworks_base-04970d654d96404cff60f774c1b7a02da03c75fd.tar.bz2 |
am 3392b8e2: am 4a2e478a: Merge "Flush Binder commands in ndk looper." into gingerbread
* commit '3392b8e23e7eb0275071af621802ed04c829c911':
Flush Binder commands in ndk looper.
Diffstat (limited to 'native')
-rw-r--r-- | native/android/looper.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/native/android/looper.cpp b/native/android/looper.cpp index 9f5cda9..615493f 100644 --- a/native/android/looper.cpp +++ b/native/android/looper.cpp @@ -19,9 +19,11 @@ #include <android/looper.h> #include <utils/Looper.h> +#include <binder/IPCThreadState.h> using android::Looper; using android::sp; +using android::IPCThreadState; ALooper* ALooper_forThread() { return Looper::getForThread().get(); @@ -46,6 +48,7 @@ int ALooper_pollOnce(int timeoutMillis, int* outFd, int* outEvents, void** outDa return ALOOPER_POLL_ERROR; } + IPCThreadState::self()->flushCommands(); return looper->pollOnce(timeoutMillis, outFd, outEvents, outData); } @@ -55,7 +58,8 @@ int ALooper_pollAll(int timeoutMillis, int* outFd, int* outEvents, void** outDat LOGE("ALooper_pollAll: No looper for this thread!"); return ALOOPER_POLL_ERROR; } - + + IPCThreadState::self()->flushCommands(); return looper->pollAll(timeoutMillis, outFd, outEvents, outData); } |