summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Jeff Brown <jeffbrown@google.com> 2011-01-16 16:15:32 -0800
committer Android (Google) Code Review <android-gerrit@google.com> 2011-01-16 16:15:32 -0800
commit4a2e478a5bf6b4650181d1dfa643eadcc387fcec (patch)
treeedba835d0fa6a5b032eed7a5b32ffba1079fc17b
parent6687ecb447025a1c56253d0fd67ad30af070db17 (diff)
parentc70bed01ac1c38d278fb3a656aaea23ab0fec73e (diff)
Merge "Flush Binder commands in ndk looper." into gingerbread
-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 9f5cda9a9e98..615493fe9a6c 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);
}