summaryrefslogtreecommitdiffstats
path: root/native
diff options
context:
space:
mode:
authorJeff Brown <jeffbrown@google.com>2011-01-10 14:36:37 -0800
committerJeff Brown <jeffbrown@google.com>2011-01-10 14:37:46 -0800
commitc70bed01ac1c38d278fb3a656aaea23ab0fec73e (patch)
treef8122003c7d403d714f50ef21936b2ba1c5d3180 /native
parentca36d863cc1684807e93f442c5ace89f08b9b5f5 (diff)
downloadframeworks_base-c70bed01ac1c38d278fb3a656aaea23ab0fec73e.zip
frameworks_base-c70bed01ac1c38d278fb3a656aaea23ab0fec73e.tar.gz
frameworks_base-c70bed01ac1c38d278fb3a656aaea23ab0fec73e.tar.bz2
Flush Binder commands in ndk looper.
Bug: 3258183 Change-Id: I943808d6297a442b84ec95643e88ceb125f8c0c6
Diffstat (limited to 'native')
-rw-r--r--native/android/looper.cpp6
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);
}